DIY Ruby on Rails Upgrades: Essential Open Source Tools

DIY Ruby on Rails Upgrades: Essential Open Source Tools

At FastRuby.io opens a new window , we deeply value the Ruby and Rails communities and believe in giving back through open source contributions. We wouldn’t be where we are today if it wasn’t thanks to a lot of open source projects we use on a daily basis.

We actively use, maintain, and enhance several tools designed to empower developers and teams who want to handle Ruby and Rails upgrades themselves, especially those who might not have the budget to hire our services.

These open source projects facilitate upgrades by improving transparency, managing technical debt, and ensuring smooth transitions between Ruby and Rails versions.

Here’s an overview of each tool and how it can support your next upgrade project.

NextRails: Manage Deprecations & Dual Booting

NextRails opens a new window is designed to simplify dual booting your Rails application with two different Ruby or Rails versions simultaneously.

Sample of a dual booted gemfile

It’s particularly helpful for tracking deprecation warnings across your test suite, making the transition to newer versions seamless and safer.

RubyCritic: Quickly Assess Your Codebase

RubyCritic opens a new window helps you get an insightful overview of any Rails application, especially when landing on unfamiliar territory.

RubyCritic overview of the Skunk open source project

While we did not create this project, our team regularly contributes to RubyCritic, notably adding a code coverage section to clearly illustrate the state of testing across your application.

RubyCritic code coverage verview of the Skunk open source project

Skunk: Identify Technical Debt Hotspots

Skunk opens a new window combines metrics such as churn (how often files change), complexity, and code coverage to highlight potential risks or blockers during upgrades.

High churn, high complexity, and low code coverage areas usually indicate parts of your codebase that will need thorough manual QA.

Skunk report on the console

Skunk.fyi: Easily Share Your Skunk Reports

Skunk.fyi opens a new window makes sharing Skunk reports straightforward and effective.

SHARE=true bundle exec skunk app lib config

If you run Skunk with the SHARE environment variable set to true, it will upload your report to skunk.fastruby.io opens a new window for easy collaboration with teammates, clients, or other stakeholders.

Here you can see an example: Skunk Report Sample opens a new window

Skunk report on Skunk.fyi

RailsBump.org: Gem Compatibility Checker

RailsBump opens a new window powers RailsBump.org opens a new window , a quick way to check your Gemfile.lock compatibility with Rails versions from 2.3 up to 8.0.

It also verifies whether gems are compatible with the Rails version you’re targeting, streamlining the planning phase of your upgrade.

RailsBump uses GitHub Actions (checker opens a new window ) to automate the compatibility checks, providing rapid insights.

RailsBump.org Homepage

FastRuby.io Audit: Bundler Audit Check

FastRuby.io Audit opens a new window is behind audit.fastruby.io opens a new window , a fast and accessible tool to run bundle-audit on your Rails project’s dependencies.

Using this tool you can easily discover and share vulnerabilities in your Gemfile.lock to ensure security issues are caught early.

Bundler Audit Report Sample

Rails Stats: Better Application Metrics

Rails Stats opens a new window enhances Rails’ native rake stats task by integrating bundle-stats and offering a more comprehensive breakdown of your Rails directories.

It’s ideal for gauging the size and complexity of your application quickly.

Custom Heroku Buildpack: Multiple Gemfiles

When deploying multiple Gemfiles to Heroku, our custom buildpack opens a new window simplifies dual booting on staging, production, or Heroku review apps, significantly easing the deployment process during upgrades.

Here’s how you can use our tools for a Ruby or Rails upgrade project:

  1. Size & Complexity Analysis: Run rails_stats to quickly assess application complexity.
  2. Technical Debt Assessment: Use RubyCritic and Skunk to pinpoint problematic code areas.
  3. Security Check: Verify dependencies security via audit.fastruby.io.
  4. Analyze Compatibility: Use RailsBump.org to check your Gemfile.lock against targeted Rails versions.
  5. Address Deprecation Warnings: Use NextRails to identify and address deprecation warnings.
  6. Dual Boot Setup: Implement dual booting with NextRails to easily switch between different versions of Rails.
  7. Continuous Integration (CI): Configure CI to test both current and target Rails versions.
  8. Staging & QA: Deploy your upgraded Rails version to staging with the Heroku buildpack for rigorous QA. Leverage Skunk reports to estimate required QA effort.

Contributing to These Tools

We enthusiastically welcome issues, feature requests, and pull requests across all our open source projects. Your contributions help us enhance these tools further, benefiting the wider Ruby community.

If you try these tools and run into time constraints or challenges, we’d love to help. Reach out to discuss additional open source improvements or our professional Rails upgrade services.

Upgrade Guides

All these tools, combined with these upgrade guides, are a great combination to take a stab at upgrading any Ruby or Rails application:

Happy upgrading! 🚀

Who we are:

FastRuby.io opens a new window specializes in Ruby on Rails application upgrades and maintenance. With a focus on reducing technical debt, our dedicated team helps startups to Fortune 500 companies optimize their applications for performance, security, and maintainability.

To learn more about our services:

Get the book