Upgrade your dependencies before you have to
Key takeaway: Treat upgrades as a weekly habit backed by tests you trust, so no single upgrade grows into a project.
Upgrade your dependencies in small steps, all the time, while each one is a few lines of lockfile. If you wait until you have to, it turns into a quarter-long project.
Security fixes land in current releases. Once your version falls out of its support window, the next CVE gets patched for everyone but you. Current versions also bring free performance, like Ruby 3.2 declaring YJIT production-ready, and keep you compatible with the OS, database, and runtime moving around you.
Picture an app three major Rails versions behind. Every deprecation from three cycles lands at once. Gems need upgrading too, with their own breaking changes. The branch drifts from main for weeks, and when forty tests fail nobody knows which change broke which.
The Rails upgrade guide recommends moving one minor version at a time to make good use of the deprecation warnings. The same idea works well outside Rails. Make deprecations loud so they get fixed as they arrive:
# config/environments/test.rb
config.active_support.deprecation = :raise
For big jumps, dual-boot: keep a second lockfile on the next version and run CI against both. Shopify’s bootboot gem is one way.
Let Dependabot or Renovate open the PRs. Group minor and patch bumps into one weekly PR, and let major versions come through alone so a person reads the changelog.
Automation only opens the PR. Whether it gets merged depends on whether you trust your tests. With a suite you trust, a green upgrade PR is a two-minute decision. If tests that make network requests keep going red for no reason, nobody believes red, the PRs pile up, and you’re back to big-bang upgrades.