---
title: Upgrade Rails Version (7.2 to 8.0)
url: https://calvin.my/posts/upgrade-rails-version-7-2-to-8-0
published: 2024-12-11
updated: 2026-09-17
category: Development
tags:
- Rails
- Upgrade
summary: 'The post outlines a Rails 7.2 to 8.0 upgrade process: update Rails incrementally, review documented breaking changes, enable relevant framework defaults, and run tests at each stage. The example highlights careful resolution of file conflicts, consideration of the Propshaft asset pipeline, and an undocumented stylesheet reference change. It also notes that migration needs vary by existing tools and deployment choices, such as whether containerization is used.'
---

# Upgrade Rails Version (7.2 to 8.0)

The official guide to upgrading the Rails version is available [here](https://guides.rubyonrails.org/upgrading_ruby_on_rails.html).

* * *

In general, there are four steps to follow:

1. Upgrade the rails version to the next available minor version.

2. Check the major impacts and change points in the upgrade guide.

3. Check the config\initializers\new\_framework\_defaults\_x.rb file

4. Run application test

Finally, repeat the steps 1-4 above until you have successfully upgraded to the target version.

* * *

Example of upgrading from Rails 7.2 to 8.0

## Upgrading the Rails version

1. In the Gemfile, edit the Rails gem version.

   ```ruby
   # gem 'rails', '~> 7.2.1'
   gem 'rails', '~> 8.0'
   ```

2. Update the gem and run the upgrade task.

   ```bash
   $ bundle update rails
   $ rails app:update
   ```

3. In this process, file conflicts are prevalent. You should carefully merge what is necessary.

* * *

## Check major changes

1. I already used the solid queue gem. Migration is unnecessary.

2. However, there is a new asset pipeline library - Propshaft.

3. The upgrade guide is available [here](https://github.com/rails/propshaft/blob/main/UPGRADING.md). Not all steps are necessary, and it depends on your current setup. If you are not using "webpacker" (or similar) and "sass" most likely the steps are straightforward.

   ![](https://camy-pub.s3.ap-southeast-1.amazonaws.com/e559e12d-a5cc-4f64-946d-db629193a924.png)

4. There is a change which is not mentioned in the documentation.

   ```ruby
   # layout/application.html.erb

   # Old
   <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>

   # New
   <%= stylesheet_link_tag :app, "data-turbo-track": "reload" %>
   ```

5. I decided not to install Kamal Gem since I am not doing a containerized deployment.

* * *

## Turn on necessary defaults

1. In config\initializers\new\_framework\_defaults\_8\_0.rb, check and turn on new default values.

   ```ruby
   Rails.application.config.active_support.to_time_preserves_timezone = :zone
   Rails.application.config.action_dispatch.strict_freshness = true
   Regexp.timeout = 1
   ```

* * *

## Test

Finally, run your application testing.
