Upgrade a Rails 7 Application to Ruby 3.2.2
Channel: Stateless Code
Date: 2023-04-04

Ruby 3.2.2 was released on March 30, 2023. It has a couple of security fixes and hopefully will also fix the pesky dependency issue we've been encountering with the debug gem.

We upgraded to 3.2.1 a few videos ago, so we use that commit as our blueprint. We install Ruby 3.2.2 using RVM. Then we run bundle install to install our gems on 3.2.2. We probably could have gotten away with just doing a bundle update here since we were intending to do that anyway and we could always reset to the HEAD in Git if something went wrong.

We spend a little time trying to get the app to use the latest version of bundler, ultimately solving it by updating the BUNDLED WITH attribute in our Gemfile.lock. Probably not the most elegant way to solve the problem, but it works.

This video covers:
00:00:12 Introduction
00:01:57 Take a look at the commit of our previous Ruby upgrade
00:02:39 Update the Ruby version in the .ruby-version and Gemfile
00:02:54 Install Ruby 3.2.2 with RVM
00:03:53 Run `bundle install`
00:04:31 Run `bundle update`
00:05:23 Get the app to bundle with the latest version of bundler
00:08:10 Run RuboCop and test suite
00:08:44 Review and commit. Double check that debug dependencies are correct
00:10:28 Push, pull request, merge, close issue

#ruby #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 #bundler #rvm

See other related StatelessCode videos:
- Upgrade to Ruby 3.2.1 and Rails 7.0.4.3 https://youtu.be/XvRzpoWfM9Q
- Update a Rails 7 Application to use Ruby 3.2 https://youtu.be/C_UzpLST3us