3 mins read

A Complete Guide to Upgrading Your Rails from 7.2 to 8.0

Get your Rails app up to date with the latest version! Follow this guide for a hassle-free upgrade from Rails 7.2 to 8.0.
Ruby gem displayed on right side of the image representating Ruby on Rails and on the left we have the blog title Upgrade Rails from 7.2 to 8.0

Raisa Kanagaraj

Technical Content Writer

Ruby gem displayed on right side of the image representating Ruby on Rails and on the left we have the blog title Upgrade Rails from 7.2 to 8.0

Upgrading to the latest version of Ruby on Rails is essential to keep your application secure, efficient, and compatible with new features. This Rails Upgrade Guide walks you through the crucial steps for upgrading your Rails application from version 7.2 to Rails 8.0.

Why Upgrade to Rails 8.0?

Upgrading to Rails 8.0 isn’t just about security patches and better performance—it’s about future-proofing your application. Staying on an outdated version of Rails can lead to increasing tech debt, compatibility issues with modern libraries, and a slower development experience.

Key Benefits of Upgrading from Rails 7.2 to Rails 8.0

1. Long-Term Maintainability

  • Older versions of Rails eventually stop receiving bug fixes and security updates. Rails 8 ensures your app remains maintainable and compatible with the latest ecosystem.
  • Reduces the risk of running into unsupported gems or outdated dependencies.

2. Reduced Technical Debt

  • If your app has skipped previous upgrades, it might contain deprecated code and workarounds. Upgrading now helps clean up legacy code and improve maintainability.
  • Encourages the use of modern coding practices that align with Rails' evolving conventions.

3. Better Developer Experience

  • Rails 8 introduces built-in authentication, reducing reliance on third-party gems like Devise for basic authentication needs.
  • Improved debugging and logging tools make troubleshooting faster and easier.

4. Performance & Scalability Enhancements

  • New caching improvements (Solid Cache) streamline backend performance and reduce external dependencies.
  • Database optimizations in Active Record help in handling large datasets more efficiently.

Rails 7.2 vs. Rails 8.0: Key Differences

Feature Rails 7.2 Rails 8.0
Minimum Ruby Version Ruby 2.7+ Ruby 3.2+
Authentication Requires Devise or similar gems Built-in authentication system
Caching System Fragment caching Solid Cache (better performance)
Asset Pipeline Sprockets by default Propshaft replaces Sprockets
Database Adapter Handling Legacy adapter handling Deprecated adapters removed for efficiency
Deprecation Handling Allowed some deprecated methods Major deprecated features removed
Performance Standard Rails optimizations Faster queries & reduced memory usage in ActiveRecord

Steps to Upgrade Rails

Preparing for the Rails Upgrade

Before diving into the upgrade process, ensure you have taken these necessary precautions:

  • Your application should be on the latest Rails 7.2.x patch before upgrading to Rails 8.0.
  • Aim for at least 80% test coverage to catch potential issues early.
  • Use a staging environment that closely mirrors production for thorough testing.
  • Check Gemfile.lock for gems compatibility issues using RailsUp. RailsUp helps in finding gems compatability and gives you the complexity score along with the estimated time to upgrade to the latest version of Ruby on Rails.
  • Set up dual booting to test your app on both Rails versions.

For a detailed breakdown, refer to the official Ruby on Rails guide.

Upgrade Strategy: Big Bang vs. Incremental Approach

Should You Upgrade in One Go or in Stages? When upgrading Rails, there are two main approaches:

Big Bang Upgrade (All at Once)

  • Involves updating the entire application in a single go.
  • Best suited for smaller apps with minimal dependencies.
  • Requires a dedicated upgrade window and extensive pre-upgrade testing.

Incremental Upgrade (Step-by-Step)

Preferred for large, complex applications. Helps minimize disruptions by updating smaller parts of the app progressively. Reduces risk by catching and fixing issues in smaller iterations.

Dual Booting with rails_multiversion

If you're opting for an incremental upgrade, dual booting can be extremely useful. The railsmultiversion_ gem allows your application to run on two different Rails versions simultaneously, helping teams test Rails 8 compatibility while still running on Rails 7.2.

Upgrading the Ruby Version

Rails 8.0 requires a minimum Ruby 3.2 version. Ensure your application is running on a compatible Ruby version. You can use RailsUp to check if your version is compatible to upgrade to the latest version of Ruby on Rails.

Checking and Updating Gems

Before upgrading, verify that all gems in your application support Rails 8.0.

  • Visit the GitHub pages of your installed gems to check compatibility.
  • If you’re a gem maintainer, update your gem to support Rails 8.0.
  • Use RailsUp to identify outdated or incompatible gems.
  • Run bundlereport outdated using the nextrails gem to get an overview of gems requiring an update.

Updating Configuration Files

Rails provides the rails app:update task to help update configuration files. You can follow this guide.

Reviewing Official Rails Guides

Always refer to the official Rails Guides to stay updated on best practices and new changes introduced in Rails 8.0.

Notable New Features in Rails 8.0

Built-In Authentication

Rails 8.0 introduces a default authentication generator, eliminating the need for third-party gems for basic authentication functionalities. This simplifies setting up:

  • Database-backed sessions
  • Password resets
  • User authentication flows

Updating Your Application Code

If you have previously ignored deprecation warnings, you might encounter breaking changes in Rails 8.0. Ensure that the following deprecations are removed:

1.Railties

  • Removed config.readencryptedsecrets
  • Deprecated Rails console extensions removed (rails/console/app, rails/console/helpers, etc.)
  • Removed Rails::ConsoleMethods support

2.Action Pack

  • Removed Rails.application.config.actioncontroller.allowdeprecatedparametershash_equality

3.Action View

  • Removed support for passing nil to model: in formwith_
  • Removed support for passing content to void tag elements in the tag builder

4.Active Record

  • Deprecated configurations removed, such as config.activerecord.committransactiononnonlocalreturn
  • Removed support for finding unregistered database adapters
  • Removed deprecated support for defining enum with keyword arguments
  • Removed config.activerecord.warnonrecordsfetchedgreaterthan
  • Removed config.activerecord.sqlite3deprecatedwarning_
  • Removed ActiveRecord::ConnectionAdapters::ConnectionPool#connection
  • Removed support to passing a database name to cachedumpfilename
  • Removed support to setting ENV["SCHEMACACHE"]_

5.Active Support

  • Removed ActiveSupport::ProxyObject
  • Removed support for attrinternalnamingformat_ using the @ prefix
  • Remove deprecated support to passing an array of strings to ActiveSupport::Deprecation#warn

6.Active Job

  • Removed config.activejob.usebigdecimalserializer

For a detailed list of removals, refer to the official Rails 8.0 changelog.

Testing Strategies for a Rails Upgrade

Upgrading Rails introduces breaking changes that may affect your app’s functionality. A robust testing strategy helps detect regressions early.

1. Automated Testing Checklist

  • Run the full test suite using rspec or minitest
  • Ensure 80%+ test coverage before upgrading
  • Use rails-upgrade gem to check for deprecated methods
  • Test background jobs (Sidekiq, DelayedJob)
  • Validate email delivery, API calls, and third-party integrations

2. Manual Testing Guidelines

  • Test user authentication and sessions
  • Validate file uploads, form submissions, and data processing
  • Check UI behavior (especially if using Hotwire or Stimulus)
  • Perform end-to-end testing in a staging environment
  1. Catching Edge Cases Using Feature Flags

Instead of enabling all changes at once, use feature flags to gradually enable Rails 8 features. This allows selective testing and rollback in case of issues. You can use Flipper or Rollout gem to control feature rollouts.

You’re on Rails 8!

By following these steps, you ensure a stable, high-performing Rails 8 application that’s ready for future growth.

If you encounter challenges or need expert guidance, our RailsFactory team is here to assist you with your Rails Upgrade process, ensuring a smooth transition to the latest version of Ruby on Rails.

Written by Raisa Kanagaraj

Your one-stop shop for expert RoR services

Join 250+ companies achieving top-notch RoR development without increasing your workforce.

Book a 15-min chat