Andy from Webcrunch

Subscribe for email updates:

Portrait of Andy Leverenz
Andy Leverenz

February 21, 2022

Last updated November 5, 2023

Upgrade from Rails 6 to Rails 7 -

Upgrading a Ruby on Rails application can be a downright chore. There are many steps to consider and that varies depending on your version of Rails. It's often advised to upgrade from a major version to the next major version in line, though your results may vary.

In this guide, I'll be taking a new "day in the life" approach toward upgrading (a Rails 6 app) to Rails 6. It isn't meant to be followed verbatim since my app isn't the same as yours but my hope is you can take cues from my process on how to achieve success with your own upgrade.

This video is long and probably boring at times but I didn't want to remove the troubleshooting steps I had for the most part. There are instances where I cut ahead to a solution but it's only to consider your time as I know it's the most precious thing we have!

The biggest hurdle with this upgrade is moving off of webpacker and into a new front-end/asset building protocol.

A few gems we'll leverage in this guide include:

Rails 7 now ships with both stimulus-rails and turbo-rails but any app preceding this version will of course need to accommodate it if you want to make use of the latest and greatest features.

With these gems comes accompanying node module dependencies. With modern browsers, we're lucky enough to no longer need a build tool like Webpack to do a lot of things. Those that use React, Vue, Svelte, or any other JavaScript dependent framework may still need something of that sort. jsbundling-rails allows you to still make use of those tools. I recommend reading the README for that gem for installation instructions.

Turbo is also new to Rails 7 apps. I hope to take a closer look at turbo and use more real-time capabilities with Rails in the future so be on the lookout for that!

Link this article
Est. reading time: 2 minutes
Stats: 2,829 views



Part of the Ruby on Rails collection