Ruby on Rails Version Upgrades
We have been running Ruby on Rails in production since version 2.3. Over that time almost every major and minor upgrade has landed on our desk - which means we know the breaking changes, the dead-end gems, and the workarounds before they cost you a production incident.
Why upgrade?
An outdated Rails application accumulates risk the longer it stays behind:
- Security patches stop for old Ruby and Rails versions
- Gems drop support for old Rails versions, blocking further updates
- Hiring and onboarding gets harder the further you are from current Rails
- Hosting providers and buildpacks eventually stop supporting old runtimes
The longer an upgrade is postponed, the bigger the jump - and the bigger the risk - gets. We prefer to keep projects on a steady upgrade path instead of one big, risky rewrite.
How we upgrade
- One minor version at a time, never skipping majors
- Rely on a solid test suite as a safety net - see our approach to Test Driven Development
- Run the upgrade path through Continuous Integration before it ever touches a developer machine
- Replace or remove gems that are abandoned or blocking the upgrade
- Ship the upgrade through Continuous Delivery so it can be rolled out and verified without manual intervention
From experience
Some of what we have run into and written up along the way:
- Working with Legacy Ruby on Rails: spring.gem fork() Crash
- Howto remove sprockets-rails from your Ruby on Rails project
- Howto migrate from Webpacker to jsbundling-rails in Ruby on Rails
- Howto migrate from Webpacker to cssbundling-rails in Ruby on Rails for CSS
- Analyzing SassC::SyntaxError in Ruby on Rails 7.0
- Deploy Ruby on Rails 7.0 to Dokku micro PaaS
Summary
Upgrading Ruby on Rails is rarely just bundle update. It touches the asset
pipeline, background jobs, deployment, and every gem in between. We have done
it enough times, on enough versions, to get your project onto a current,
supported Rails release without breaking what already works.
Have an application stuck on an old Rails version? Get in touch.