Upgrade Rails from 7.2 to 8.0

Upgrade Rails from 7.2 to 8.0

This article is part of our Upgrade Rails series. To see more of them, click here opens a new window .

This article will cover the most important aspects that you need to know to get your Ruby on Rails opens a new window application from version 7.2 opens a new window to version 8.0 opens a new window .

  1. 1. Preparations
  2. 2. Ruby Version
  3. 3. Gems
  4. 4. Config Files
  5. 5. Rails Guides
  6. 6. Notable New Features
  7. 7. Application Code
  8. 8. Next Steps

1. Preparations

Before beginning with the upgrade process, we have some recommended preparations:

For full details check out our article on How to Prepare Your App for a Rails Upgrade opens a new window .

2. Ruby Version

For the Rails 8.0 release, Ruby 3.2 opens a new window is the required minimum version.

Check out our Ruby & Rails Compatibility Table opens a new window to see all the required Ruby versions across all Rails versions.

3. Gems

Make sure you check the GitHub page of the gems currently installed in your application for more information about compatibility with Rails 8.0. If you are the maintainer of the gem, you’ll need to make sure it supports Rails 8.0. A great tool to checkout gems compatibility is RailsBump opens a new window . We also encourage you to use the next-rails opens a new window gem to run bundle_report outdated for more information on gems that will require an update. Check out our article on The Next Rails Gem opens a new window to learn more.

4. Config Files

Rails includes the rails app:update task opens a new window . You can use this task as a guideline as explained thoroughly by this Revisiting rails:update opens a new window blog post.

As an alternative, check out RailsDiff opens a new window , which provides an overview of the changes in a basic Rails app between 7.2.x and 8.0.x (or any other source/target versions).

5. Rails Guides

It is important to check through the official Rails Guides opens a new window and follow any of the steps necessary for your application.

6. Notable New Features

Built-In Authentication: Rails now provides a default authentication generator. This simplifies setting up essential features, such as database-backed sessions and password resets, without relying on external gems.

7. Application Code

If you have ignored deprecation warnings on past version jumps, and haven’t stayed up to date with them you may find that you have issues with broken tests or broken parts of the application. If you have trouble figuring out why something is broken it may be because a deprecation is removed. The following is a list of the removals in Rails 8.0.

7.1 Railties
  • Remove deprecated config.read_encrypted_secrets.
  • Remove deprecated file rails/console/app.
  • Remove deprecated file rails/console/helpers.
  • Remove deprecated support to extend Rails console through Rails::ConsoleMethods.
  • See full list of changes in the changelog opens a new window .
7.2 Action Pack
  • Remove Rails.application.config.action_controller.allow_deprecated_parameters_hash_equality.
  • See full list of changes in the changelog opens a new window .
7.3 Action View
  • Remove deprecated support to passing nil to the model: argument of form_with.
  • Remove deprecated support to passing a content to void tag elements on the tag builder.
  • See full list of changes in the changelog opens a new window .
7.4 Active Record
  • Remove deprecated config.active_record.commit_transaction_on_non_local_return.
  • Remove deprecated config.active_record.allow_deprecated_singular_associations_name.
  • Remove deprecated support to finding database adapters that aren’t registered to Active Record.
  • Remove deprecated support for defining enum with keyword arguments.
  • Remove deprecated config.active_record.warn_on_records_fetched_greater_than.
  • Remove deprecated config.active_record.sqlite3_deprecated_warning.
  • Remove deprecated ActiveRecord::ConnectionAdapters::ConnectionPool#connection.
  • Remove deprecated support to passing a database name to cache_dump_filename.
  • Remove deprecated support to setting ENV["SCHEMA_CACHE"].
  • See full list of changes in the changelog opens a new window .
7.5 Active Support
  • Remove deprecated ActiveSupport::ProxyObject.
  • Remove deprecated support to setting attr_internal_naming_format with a @ prefix.
  • Remove deprecated support to passing an array of strings to ActiveSupport::Deprecation#warn.
  • See full list of changes in the changelog opens a new window .
7.6 Active Job

8. Next Steps

If you successfully followed all of these steps, you should now be running Rails 8.0!

If you find yourself in need of assistance or your team doesn’t have the time to tackle these challenges, you can always contact us. Our experts are here to help you navigate the upgrade process and ensure your Rails application continues to thrive. opens a new window

Download our free eBook: The Complete Guide to Upgrade Rails opens a new window .

Get the book