February 21, 2022
•Last updated November 5, 2023
Upgrade from Rails 6 to Rails 7 - web-crunch.com
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 web-crunch.com (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!
Categories
Collection
Part of the Ruby on Rails collection
Products and courses
-
Hello Hotwire
A course on Hotwire + Ruby on Rails.
-
Hello Rails
A course for newcomers to Ruby on Rails.
-
Rails UI
UI templates and components for Rails.