The Path to Rails 8 - Upgrade Rails from 7.1 to 7.2 @StatelessCode
The Path to Rails 8 - Upgrade Rails from 7.1 to 7.2  @StatelessCode
Uploaded May 2025 | Updated September 2026, 3 weeks ago
Having recently upgraded from Rails 7.0 to 7.1, we continue down our path to Rails 8 by upgrading to Rails 7.2. In terms of the number of things called out by the Upgrading Ruby on Rails guide, 7.1 to 7.2 is less overall change than the upgrade from 7.0 to 7.1 was.

Our upgrade succeeds without much fanfare. The automated and manual tests pass, and we're able to commit our changes.

One important call-out for this upgrade is the ability to add configuration to your controller to allow only modern browser versions. We do this by adding the line `allow_browser versions: :modern` to the top of our ApplicationController file, which all other controllers inherit from.

This video covers:
0:00:00 Introduction
0:03:04 Update Gemfile to latest version of 7.2 and remove gems added to Gemfile to get Rails 7.0 working with Ruby 3.4
0:05:12 Run the Rails upgrade script, resolve conflicts, and review the Git diff
0:09:11 Review and enable the new framework defaults for Rails 7.2
0:10:04 Run automated tests, fix RuboCop violations, and do manual regression test with new defaults in place
0:11:53 Add the `allow_browser versions: :modern` constraint to ApplicationController
0:12:44 Commit (amend the accidental commit of the new framework defaults file), push, and update the project

#ruby #rails8 #rails7 #rails #rubyonrails #rubygems #codecast #screencast #github #opensource #minitest #TDD #agile #NerdDice #DnD #roleplaying #softwaredevelopment #learntocode #tailwind #postgresql #rubocop #devise #turbo #controllers #views #selenium #capybara #systemtest

See other related StatelessCode videos:
- youtu.be/QbeSvdAxknk
- youtu.be/RGmj7QcCVmM
- youtu.be/RR31ztGtrhA

Resources that we relied upon for this solution:
- Upgrading Ruby on Rails guide (7.1 to 7.2 section in particular) guides.rubyonrails.org/upgrading_ruby_on_rails.html#upgrading-from-rails-7-1-to-rails-7-2
- Rails 7.2 release notes guides.rubyonrails.org/7_2_release_notes.html

GitHub Commit for this Video:
- github.com/statelesscode/nerd_dice_dot_com/commit/7dabca1
The Path to Rails 8 - Upgrade Rails from 7.1 to 7.2Codecast: Create a RubyGem 82: Add method_missing methods to Benchmark ScriptAdd Coveralls to a Rails 7 ProjectMediocre Karaoke - The Long and Winding Road by The BeatlesRails 8 Development with Dev Containers and rails-newReview a Pull Request from Our Devise Tailwind Video: Rails Helpers or Tailwind Directives?The Way of the Waveform - How I Trimmed 30 Minutes of Dead Air from a Coding Video with OpenShotInkscape 06: Rework the Stateless Code Logo and Make a Nerdy DieCodecast: Getting Started with Rails 7 22: Broadcast Comment Changes to the Article with Turbo300 Videos! 300 Badges!Create a RubyGem 96: Drop Official Support for End-of-Life Ruby 2.7Set up a Salesforce Development Environment on Ubuntu 24.04
Stateless Code |

The Path to Rails 8 - Upgrade Rails from 7.1 to 7.2

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER