A Rails upgrade is rarely urgent on the day you think about it, and that is exactly why it gets postponed. Then a security advisory lands for a version you can no longer patch, or a gem you depend on drops support for your release. This Rails upgrade guide is written for CTOs and lead developers who need a method, not a pep talk: how to check where you stand, how to prepare, how to move from Rails 7 to Rails 8 without freezing the roadmap, and what the work really involves.
It reflects how we run upgrades at Akolads, a Ruby on Rails agency founded in 2018 and based near Lyon, France. If you need a refresher on the framework itself, see Ruby on Rails: definition and how it works.
Why upgrade Rails at all
Security support windows
This is the argument that should settle the question. The Rails core team only patches a limited set of releases. Under the official Rails maintenance policy, in place since Rails 7.2, each minor release receives bug fixes for one year and security fixes for two years after it ships. Once your version leaves that window, a newly disclosed vulnerability is fixed for everyone except you.
Performance
Recent Rails versions are built for recent Ruby versions, and that is where most of the gain comes from. Rails 7.2 enables YJIT, Ruby's just-in-time compiler, by default on Ruby 3.3 and later. Measure the gain on your own workload instead of trusting a generic percentage.
Hiring and gem ecosystem
Developers prefer working on a current stack, and gem maintainers test against supported Rails versions first. On an old release you gradually lose both, and every feature becomes more expensive to ship.
Which Rails version are you on, and is it supported
Start with facts. From the root of the application:
bin/rails about # Rails, Ruby, database adapter, environment
bundle exec rails -v # Rails version only
ruby -v # Ruby version actually in use
grep -n "load_defaults" config/application.rb
The last line matters as much as the first. An application can run the Rails 7.1 gem while still declaring config.load_defaults 6.1, which means it runs on the behaviours of an older release. That gap is hidden upgrade debt.
Then compare your Rails version with the maintenance policy page linked above. Do not rely on a date copied from a blog post, this one included: the supported list changes with every release. Do the same check for Ruby on ruby-lang.org.
| Rails version | Minimum Ruby | What to know before upgrading to it |
|---|---|---|
| 7.0 | 2.7 | Zeitwerk is the only autoloader, Hotwire and import maps become the defaults for new applications |
| 7.1 | 2.7 | Generated Dockerfile, config.autoload_lib, Rails.application.secrets deprecated |
| 7.2 | 3.1 | YJIT on by default with Ruby 3.3+, dev containers, Rails.application.secrets removed |
| 8.0 | 3.2 | Solid Queue, Solid Cache, Solid Cable, Kamal 2, Propshaft and the authentication generator |
Preparing the upgrade
Most of the outcome is decided before the Rails version changes. Four things need to be in place.
A test suite you can trust
The test suite is the only thing that tells you whether an upgrade broke something. You do not need full coverage, you need coverage of what would hurt: sign-in, payment, the main business workflows, background jobs, and outgoing emails. If the suite is thin, write system or request tests for those paths first. If you are unsure what state the application is in, a Rails code audit gives you that picture before you commit to a schedule.
A dependency audit
Gems block more upgrades than Rails itself does.
bundle outdated # what is behind, and by how much
bundle exec bundler-audit check --update # known vulnerabilities (bundler-audit gem)
For each gem that is several major versions behind, check three things: does a release compatible with your target Rails exist, is the gem still maintained, and is it still needed. Abandoned gems have to be replaced, forked or removed. Update everything that can be updated before touching Rails, in small separate pull requests.
Zero deprecation warnings
Rails announces breaking changes one version ahead through deprecation warnings. What your current version warns about, the next one removes. Make the warnings impossible to ignore in the test environment:
# config/environments/test.rb
config.active_support.deprecation = :raise
Fix them until the suite is green again. From then on, the next version bump mostly consists of things you have already dealt with.
Ruby first
Upgrade Ruby before Rails, as a separate deployment. Rails 8.0 requires Ruby 3.2 or newer, and old Rails versions do not run on the newest Rubies, so the usual sequence alternates: bring Ruby to the newest version your current Rails supports, upgrade Rails, repeat. Changing both at once makes every failure ambiguous.
The upgrade path, one minor version at a time
The rule is simple: never skip a minor version. An application on Rails 6.1 goes 6.1 to 7.0, then 7.1, then 7.2, then 8.0. Each step is deployed to production before the next one starts. Every failure can then be traced to a small, known set of changes.
For each step, the sequence is the same:
- Move to the latest patch of your current minor version and deploy it.
- Clear the deprecation warnings on that version.
- Change the Rails version in the Gemfile and update the bundle.
- Run the update task and review each configuration diff.
- Fix the test suite, then test manually on a staging environment with production-like data.
- Deploy, monitor errors and performance for a few days, then start the next step.
# Gemfile
gem "rails", "~> 7.2.0"
# then
bundle update rails
bin/rails app:update
bundle update rails will often fail the first time because another gem pins an older Rails. The error message names the gem: update it in the same command, or go back to the dependency audit.
bin/rails app:update regenerates the configuration files of the new version and asks, file by file, whether to overwrite yours. Never accept blindly. Review each diff and keep your own settings. RailsDiff shows what a freshly generated application looks like between any two versions, and the official Upgrading Ruby on Rails guide lists the breaking changes of each release. Read the relevant section before each step.
If this sequence does not fit in your team's schedule, our Rails upgrade service follows exactly this path, with a deployment at each step.
Framework defaults and dual booting
config.load_defaults and the new_framework_defaults file
Updating the gem does not switch your application to the new behaviours. Those are controlled by config.load_defaults in config/application.rb. After an upgrade, leave it on the previous value. The update task creates a file such as config/initializers/new_framework_defaults_8_0.rb, in which every new default is listed and commented out.
# config/application.rb, right after the gem upgrade
config.load_defaults 7.2
# once every line of new_framework_defaults_8_0.rb has been enabled and tested
config.load_defaults 8.0
Uncomment the settings one at a time, or in small groups, run the tests and deploy. Some of them change how cookies, caches or serialized data are written, which matters during a rolling deployment where old and new code run side by side. When all of them are enabled, switch load_defaults to the new version and delete the file. An upgrade is only finished at that point.
Dual booting
On an application under active development, a long-lived upgrade branch becomes a merge nightmare. Dual booting avoids it: the main branch can boot on both the current and the next Rails version, and CI runs the suite on both. The usual setup is a second Gemfile, symlinked to the first, with a condition inside. The next_rails and bootboot gems automate it.
# Gemfile
def next?
File.basename(__FILE__) == "Gemfile.next"
end
if next?
gem "rails", "~> 8.0.0"
else
gem "rails", "~> 7.2.0"
end
ln -s Gemfile Gemfile.next
BUNDLE_GEMFILE=Gemfile.next bundle install
BUNDLE_GEMFILE=Gemfile.next bin/rails test
Compatibility fixes are merged into the main branch in small pull requests. For a small application with a short upgrade, a plain branch is enough.
What changes from Rails 7 to Rails 8
Rails 8.0 is less about breaking changes than about new defaults. One point is often misunderstood: these are defaults for newly generated applications. A Rails 7 to 8 upgrade does not force any of them on you.
- Solid Queue: a database-backed Active Job backend, the default for new applications. Sidekiq and the others still work on Rails 8.
- Solid Cache: a cache store that keeps entries in the database on disk instead of in memory.
- Solid Cable: a database-backed Action Cable adapter, so WebSockets no longer require Redis either.
- Kamal 2: the deployment tool shipped with new applications. It deploys Docker containers to your own servers over SSH, with Kamal Proxy for zero-downtime switches and automatic TLS certificates.
- Thruster: a small proxy placed in front of Puma in the generated Dockerfile. It adds HTTP/2, compression and asset caching without a separate Nginx configuration.
- Propshaft: the default asset pipeline, replacing Sprockets for new applications. It only serves and fingerprints files. It does not compile Sass or transpile JavaScript, so a migration needs a plan for those. Sprockets keeps working.
- Authentication generator:
bin/rails generate authenticationcreates session-based sign-in and password reset code that you own. It does not generate sign-up, and it is not a reason to rip out Devise from an existing application.
What you must handle in the upgrade itself is shorter: Ruby 3.2 or newer, the removal of everything Rails 7.2 marked as deprecated, and the new framework defaults. Treat the rest as optional follow-up projects. The Rails 8, Hotwire and PostgreSQL stack we use on new builds includes them, but we adopt them on existing applications only when they remove a real operational cost.
Common pitfalls
- Skipping versions. Going from 6.1 straight to 8.0 hides the deprecation warnings that would have guided you.
- Bumping
load_defaultsin one go. Cache and cookie format changes can break sessions or cached data during a rolling deployment, and can prevent a clean rollback. - Forgetting monkey patches. Code in
config/initializersorlibthat reopens Rails internals fails without warning. Search for it before each step. - Legacy JavaScript tooling. Applications still on Webpacker need a decision (import maps, jsbundling or Vite) that is a project in itself. Do it separately from the Rails version change.
- Stopping when production is stable. An application left on old framework defaults or on a release about to leave support will need the same work again soon. Regular Rails maintenance keeps the next upgrade small.
How much effort to plan for
There is no honest fixed figure. The size of the codebase matters less than two variables: how much you can trust the tests, and how much gem debt has accumulated. The ranges below are orders of magnitude for one experienced developer, not a quote.
| Situation | Typical effort | What drives it |
|---|---|---|
| Rails 7.2 to 8.0, good test coverage, gems up to date | A few days | Deprecations already cleared, few configuration changes |
| Rails 7.0 or 7.1 to 8.0, average coverage | One to three weeks | Two or three steps, some gem replacements, a Ruby upgrade |
| Rails 6.x to 8.0, thin coverage, old gems | One to three months | Tests to write first, JavaScript tooling to migrate, abandoned gems |
| Rails 5.x or older | Assess case by case | An audit is needed before any estimate |
Calendar time is longer than effort, because each step should spend a few days in production before the next one. If your team cannot absorb that alongside the roadmap, you can have our team run the upgrade while yours keeps shipping features.
Rails upgrade checklist
Before
- Versions known: Rails, Ruby,
load_defaults, database - Support status checked against the official maintenance policy
- Critical paths covered by automated tests, CI green
- Gems audited:
bundle outdatedreviewed, abandoned gems identified - Ruby upgraded to a version supported by the target Rails, and deployed
- Deprecation warnings raised as errors in tests, and cleared
- Staging environment and rollback procedure tested
For each minor version
- Latest patch of the current version deployed
- Upgrade guide section for the target version read
- Gemfile changed,
bundle update railsdone bin/rails app:updaterun, every diff reviewed- Tests green, manual checks done on staging
- Deployed and monitored for errors, response times and job queues
After
- New framework defaults enabled one by one
config.load_defaultsset to the new version,new_framework_defaultsfile deleted- Dual boot code removed from the Gemfile and CI
- Optional adoptions (Solid Queue, Propshaft, Kamal) listed as separate projects
- Next upgrade scheduled, so it stays a small one
If you would like a second opinion on your path, or need the whole Rails version upgrade handled from audit to production, see how our Rails upgrade and takeover offer works.
FAQ
Can I upgrade directly from Rails 6 or Rails 7.0 to Rails 8?
Technically you can change the version in the Gemfile, but it is the riskiest way to do it. Each release removes what the previous one deprecated, so skipping versions means you never see the warnings that tell you what to fix.
The reliable path is one minor version at a time: 6.1, 7.0, 7.1, 7.2, then 8.0, with a green test suite and a production deployment at each step.
Do I have to adopt Solid Queue, Kamal or Propshaft when upgrading to Rails 8?
No. They are the defaults for newly generated Rails 8 applications, not requirements for existing ones. An upgraded application keeps Sidekiq, Redis, Sprockets and its current deployment setup, and all of them keep working on Rails 8.
Treat each of them as a separate, optional project to evaluate once the upgrade itself is in production.
How long does a Rails 7 to Rails 8 upgrade take?
It depends far more on test coverage and gem debt than on the size of the codebase. A well-tested application already on Rails 7.2 is usually a matter of days. An application on 7.0 with thin coverage and abandoned gems is counted in weeks.
A short audit of the Gemfile, the test suite and the deprecation log is the only honest way to give a figure.
Which Ruby version does Rails 8 require?
Rails 8.0 requires Ruby 3.2 or newer. Rails 7.2 requires Ruby 3.1 or newer, and Rails 7.0 and 7.1 require Ruby 2.7 or newer.
In practice, upgrade Ruby first, to a version that is still maintained by the Ruby core team, deploy it, and only then start the Rails upgrade.
How do I know if my Rails version is still supported?
Run bin/rails about to get your exact version, then compare it with the official Rails maintenance policy on rubyonrails.org. Since Rails 7.2, each minor release receives bug fixes for one year and security fixes for two years after its release.
If your version no longer appears in the supported list, new vulnerabilities are not patched for it, and the upgrade becomes a security matter and not just a comfort one.