Upgrading a Ruby on Rails App from 7.2 to 8.1
Edu Depetris
- Nov 01, 2025- Ruby On Rails
- Rails 8.1
- Rails Upgrade
- Ruby 3.4
We have a Rails 7 application that’s been running smoothly for a few years, and now it’s time to upgrade it to Rails 8.1.
But the goal isn’t just to update — we want to bring the app closer to Rails defaults, reduce external dependencies, and make future upgrades easier and safer.
The app already has an excellent test suite with 95% coverage, giving us the confidence to perform big changes with minimal risk.
In this post, we’ll focus on the Ruby and Rails framework upgrade itself.
But the goal isn’t just to update — we want to bring the app closer to Rails defaults, reduce external dependencies, and make future upgrades easier and safer.
The app already has an excellent test suite with 95% coverage, giving us the confidence to perform big changes with minimal risk.
In this post, we’ll focus on the Ruby and Rails framework upgrade itself.
The migrations from GoodJob → SolidQueue and Devise → Rails Authentication will be covered in separate articles.
Reference: Rails Upgrade Guide
Prerequisites
Before starting, make sure your app has a reliable test suite — enough test that you feel confident to make changes.
We’re lucky here: our app’s 95% test coverage gives us a solid safety net during the upgrade.
Step 1: Upgrade Ruby
As the Rails upgrade guide recommends, we’ll start by upgrading Ruby.
This app is currently deployed on Heroku, and we plan to migrate it to Kamal in a future post.
For now, let’s check the Ruby versions supported by Heroku.
The app currently uses Ruby 3.3.5, and according to Heroku’s supported versions, we can upgrade to Ruby 3.4.7.
The app currently uses Ruby 3.3.5, and according to Heroku’s supported versions, we can upgrade to Ruby 3.4.7.
Upgrading Ruby:
- Update the
.ruby-versionfile - Reinstall your gems
bundle install - Run your test suite
First Issue: CSV Library Removed from Stdlib
In Ruby 3.4, the csv library is no longer part of the standard library. You now need to install it separately:
In Ruby 3.4, the csv library is no longer part of the standard library. You now need to install it separately:
bundle add csv
The good news is that it’s still maintained by the Ruby Core team.
Bonus: Default Block Parameter it
Ruby 3.4 introduces it as a default block parameter (see proposal).
It’s a small but elegant addition that makes code cleaner — and we’ll use it later in the app.
Deploying the Ruby Upgrade
After verifying that all tests pass, we deploy our app to Heroku and monitoring Rollbar and Sentry alerts for any regressions.
Step 2: Upgrade to Rails 8.0
To make the upgrade smoother, we’ll first move from Rails 7.2 → 8.0, and then from 8.0 → 8.1.
Deploying after each major version helps catch issues early.
Rails 8.0 release notes, two key features we’ll explore later are SolidQueue and Rails Authentication.
Fixing Deprecations
Before upgrading, I encountered a small enum deprecation that required a syntax fix — an easy change.
Then, following steps 1.3, 1.4, and 1.5 from the official upgrade guide:
- Update the Gemfile to use Rails 8.0
gem "rails", "~> 8.0" - Run bundle update rails
bundle update rails - Run
bin/rails app:update - Configure the new defaults:
config.load_defaults 8.0 # config/application.rbNote: In my case, I felt confident enough to enable all the new defaults at once. However, you might prefer to uncomment them feature by feature inconfig/initializers/new_framework_defaults_8_0.rb.
Minor Issues Found
- SimpleCov
Formatter SimpleCov::Formatter::CoberturaFormatter failed with REXML::ParseException: Malformed XML: No root elementFixed by updating to the latest version. - WebMock
warning: constant Net::HTTPSession is deprecatedFixed by updating to the latest version. - Devise Responders
warning: Status code :unprocessable_entity is deprecated. Use :unprocessable_content instead.Fixed with a Devise update.
Deploying the Rails Upgrade
Let's run the app for a while in production to see if we get any issues.
Step 3: Upgrading to Rails 8.1
The hardest part is behind us — now let’s move from Rails 8.0 → 8.1.
According to the Rails guidelines, this step is much easier.
Luckily, we’re not using schema.rb` and we won’t see any change on the columns order as you might see if you’re using it.
We’ll follow the same process as before:
- Update the Gemfile to Rails 8.1
gem "rails", "~> 8.1" - Run bundle update rails
bundle update rails - Run the update task
bin/rails app:update - Configure the new defaults:
config.load_defaults 8.1 # config/application.rbNote: In my case, I felt confident enough to enable all the new defaults at once. However, you might prefer to uncomment them feature by feature inconfig/initializers/new_framework_defaults_8_1.rb.
Minor Issues During the 8.1 Upgrade
ActsAsTaggableOn (AATO)
If you’re using this gem, you may encounter an arity mismatch error.
The temporary fix is to install the latest commit from GitHub until a new release is published:
ActsAsTaggableOn (AATO)
If you’re using this gem, you may encounter an arity mismatch error.
The temporary fix is to install the latest commit from GitHub until a new release is published:
gem "acts-as-taggable-on",
git: "https://github.com/mbleigh/acts-as-taggable-on.git",
ref: "f18679a73fbea042e0ce2f1929e16a5e1abbcb64"ActionText Tests
One of my tests checked for the presence of a
<video> tag in ActionText-rendered content — and it started failing.Turns out, ActionText now uses custom elements (
<action-text-attachment>) that are transformed by JavaScript on the client side.The fix: check for
content-type="video/mp4" as an alternative to the <video> tag.Done -- Rails 8.1 in Production!
That’s it! The app is now fully upgraded to Ruby 3.4.7 and Rails 8.1.
All tests are passing, the app is stable, and we’ve laid the groundwork for upcoming improvements.
Next up: we’ll explore how to migrate background jobs from GoodJob → SolidQueue, and authentication from Devise → Rails Authentication.
🎉 Happy Upgrades.