Update a Rails 7 Application to use Ruby 3.2 @StatelessCode
Update a Rails 7 Application to use Ruby 3.2  @StatelessCode
Uploaded January 2023 | Updated November 2026, 3 days ago
Even though we just updated our application to Ruby 3.1.3 in the previous video, we're going to bump the upgrade of our app to Ruby 3.2.

We follow a very similar process to what we used to upgrade from Ruby 3.1.2 to Ruby 3.1.3 in the previous video. All of the files we need to modify are still open in the editor.

Our system is Ubuntu 22.04 and we are using Ruby Version Manager (RVM) to manage our Ruby installations. We already have Ruby 3.2.0 installed on our system from the Nerd Christmas 2022 video, but when we change to the NerdDice.com directory, we can see that we're still using Ruby 3.1.3. The version in our .ruby-version file takes precedence over our RVM default, so we need to specify `rvm use 3.2.0` in our directory in order for us to update the bundle. If you don't already have Ruby 3.2.0 installed on your system, you can execute `rvm install 3.2.0` and `rvm use 3.2.0 --default` to get the needed Ruby version onto your system.

After that, we modify our Ruby version in the .ruby-version file and the Gemfile. We run a `bundle install` and re-run RuboCop and our full test suite to make sure nothing breaks before committing and pushing the code.

Unlike last time, every test now has a deprecation warning about Rack and its use of Regexp.new. The message is 3rd argument to Regexp.new is deprecated and will be removed in Ruby 3.3; use 2nd argument instead

It's not uncommon to see a slew of new deprecation warnings across our set of gems, but this is just one line of one file in Rack. We check RubyGems.org to see if new versions of Rack have been released. There is a 3.x version, but that is not supported by the version constraints of our current version of Rails ActionPack (7.0.4). We run `bundle update rack` and it updates our patch version from 2.2.4 to 2.2.5 and the deprecation warnings are gone.

This video covers:
00:00:12 Introduction
00:01:49 Take a look at current RVM Ruby versions
00:02:33 Look at previous commit for changes that need to be made
00:03:27 Make needed updates to files
00:04:41 Use rvm on the working directory to use Ruby 3.2.0 and update Gemfile.lock to use bundler 2.4.1
00:05:17 Run `bundle install` and review git diff
00:07:15 Run RuboCop and full test suite
00:08:14 Fix deprecation warnings by updating Rack and rerun tests
00:10:53 Smoke test application on Rails development server
00:12:37 Review, commit, and push code
00:13:41 Prune old branch from previous video
00:14:40 Open and merge pull request; update project
00:18:39 Outtake

#ruby #rails7 #rails #rubyonrails #rubygems #rvm #codecast #screencast #github #opensource #minitest #TDD #agile #NerdDice #DnD #roleplaying #softwaredevelopment #learntocode #rubocop #selenium #capybara #systemtest #deprecationwarning #rack

See other related StatelessCode videos:
- Upgrade a Rails 7.0 App to Ruby 3.1.3 youtu.be/DFvzWcAx-Rc
- Nerd Christmas 2022 - Ruby 3.2 Released! youtu.be/YPXum1WtuH0

This video is CC0 - No rights reserved. (YouTube doesn't allow this option when publishing.) All code is released under the UNLICENSE. Stateless Code denies the concept of "intellectual property". Copying is not stealing.
Update a Rails 7 Application to use Ruby 3.2Install Git on Ubuntu 24.04 and Configure for Verified Commits in GitHubInstall Devise 4.8 on a Rails 7 ApplicationDevise Reset Password Unhappy Path Tests and RefactoringI Will Show You a Liar #uxd #uxr #whystatelesscodeUpgrade a Rails 7.0 App to Ruby 3.1.3Populate the Project Backlog with Preliminary Features for the AppIntroduction to Agentforce: Is your Salesforce org ready?Fix a Bug Where System Test Emails Need More Time to CompleteFlesh Out the README for the ProjectThe Big End-to-End Setup of Mikes Development Environment on Ubuntu 24.04Inkscape 04: Convert Text to Vector for Cross-Platform Use
Stateless Code |

Update a Rails 7 Application to use Ruby 3.2

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER