Updating rails from 7.0.1 to 7.0.8

Dear all team,

Please help, how to update my current ruby on rails from 7.0.1 to 7.0.8 from my local development of laptop debian os 12, into my vps digital oceean

Welcome to Rails! As a patch version upgrade, this should be very straightforward, but take it step-by-step until you gain the confidence to cut corners.

Upgrade

Read the general advice in the Upgrading Ruby on Rails guide. For this small upgrade, you can probably just:

  1. Run your test suite. (it should already be passing…but :person_shrugging: :joy: )
  2. bundle update
  3. Run your test suite.

Take the time to do all the steps in the guide so you can learn and gain confidence for a bigger upgrade down the road. Start with the guides, but you can find plenty of blog posts or GoRails tutorials to learn more.

A few extra tips…

Break bundle update into small steps, especially if something breaks, if bundle outdated shows multiple gems with major-version updates, or if you aren’t familiar with each gem’s versioning strategy (not everyone follows semver). See man bundle-update for ideas (i.e. bundle update --group test, bundle update --minor, bundle update rails).

  • Skim the release notes for each gem in bundle outdated, paying special attention to major-version upgrades, breaking changes. This is tedious, but most gems are good about telling you when you need to make changes.
  • Do several commits. If you had to make code changes to upgrade a gem, this makes it easy for you to copy the update for another project.
  • Deploy small incremental updates to a test server. Some issues may not show up in development or test, like this one.
  • Don’t be afraid to remove gems that give you update troubles. Dependencies are sometimes more work than the value they provide.

This will give you good practice for Rails 7.1.0. Rails is good about adding deprecation warnings in patch releases so you can prepare for the next minor/major releases. To find deprecation warnings, review your test logs for DEPRECATION WARNING: (unless you’ve changed the default behavior in test.rb).

Deploy

This can vary, but just deploy however you did the initial release. Compare your deploy setup with this nice guide from Chris Oliver: https://gorails.com/deploy/

I use Capistrano, so it’s cap staging deploy followed by cap production deploy.

1 Like