Skip to content

Upgrade Rails to 8.1 - #47

Closed
etagwerker wants to merge 5 commits into
mainfrom
upgrade-rails-8.1
Closed

etagwerker wants to merge 5 commits into
mainfrom
upgrade-rails-8.1

Conversation

@etagwerker

Copy link
Copy Markdown
Member

Summary

Upgrades Rails from 7.0.4 to 8.1.4.1. I followed the rails-upgrade skill hop by hop (7.0.10, 7.1, 7.2, 8.0, 8.1), with one commit per hop so each step is easy to review or bisect. The suite was green (83 examples, 0 failures) after every commit.

Commits

  1. Rails 7.0.10 + ffi 1.17. Latest 7.0 patch first, per the skill. ffi 1.15.5 doesn't compile on current macOS SDKs.
  2. Rails 7.1. cache_classes became enable_reloading, test env show_exceptions = :none, fixture_paths in rails_helper. rspec-rails goes to 7.1 (5.1 doesn't work with 7.1). ombu_labs-auth goes to 1.2.0, which allows Devise 5 and gets rid of the Rails.application.secrets deprecation that would have broken on 7.2.
  3. Rails 7.2. :unprocessable_entity became :unprocessable_content (Rack 3.1 deprecation).
  4. Rails 8.0. Set to_time_preserves_timezone = :zone.
  5. Rails 8.1. pool became max_connections in database.yml, dropped the to_time_preserves_timezone override (deprecated in 8.1), and CI now installs bundler 2.5.22 to match the lockfile.

Things worth a close look

  • GitHub sign-in is not covered by specs. ombu_labs-auth 1.0.0 to 1.2.0 pulls in Devise 4.8 to 5.0 and a few new runtime dependencies (omniauth-google-oauth2, plus capybara, selenium-webdriver and puma). Google login is env-var driven, so GitHub login should be unaffected, but please try signing in on a review app before merging.
  • Bundler moved from 2.3.23 to 2.5.22. The 2.3.23 resolver spun forever on this dependency graph. CI is updated. The Dockerfile reads the version from Gemfile.lock, so it follows along.
  • load_defaults is still 7.0. I left that for follow-up PRs. The rails-load-defaults skill walks through one config per commit with testing in between, which doesn't fit in this PR.
  • force_ssl / assume_ssl are still commented out in production. Rails 8.0 and 8.1 both flag this as optional. Heroku terminates SSL for us, but it's worth a separate look.

Verification

  • bundle exec rspec: 83 examples, 0 failures on 8.1.4.1
  • bin/rails zeitwerk:check: all good
  • Booted in production mode with eager load on 8.1.4.1
  • No DEPRECATION WARNING lines in the suite output
  • Not done: a deploy to staging or a Heroku review app

🤖 Generated with Claude Code

etagwerker and others added 5 commits November 20, 2026 23:09
ffi 1.15.5 does not compile on current macOS SDKs. Rails 7.0.10 is the
latest patch of the 7.0 series, the starting point for the 8.1 upgrade.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- Bump rails to ~> 7.1.0 (7.1.6)
- cache_classes -> enable_reloading
- test env: show_exceptions = :none, rspec fixture_paths
- rspec-rails 7.1, ombu_labs-auth 1.2 (devise 5, drops the secrets deprecation)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- Bump rails to ~> 7.2.0 (7.2.3)
- :unprocessable_entity -> :unprocessable_content (Rack 3.1 deprecation)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- Bump rails to ~> 8.0.0 (8.0.5.2)
- Set to_time_preserves_timezone to :zone (8.0 deprecates true)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- Bump rails to ~> 8.1.0 (8.1.4.1)
- database.yml: pool -> max_connections
- Drop to_time_preserves_timezone override (deprecated in 8.1)
- CI: install bundler 2.5.22 to match Gemfile.lock BUNDLED WITH

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant