Repository navigation
Get the next-rails (Rails 8.0) bundle booting and green on Ruby 3.4 - #3842
muhammadsamad99 wants to merge 3 commits into
Conversation
csv stopped being a default gem in Ruby 3.4 and is now a bundled gem, so it has to be listed in the Gemfile to be loadable under Bundler. The app requires it directly (Registration and the admin CSV export views), but the Gemfile never declared it: the current lockfile only gets csv through iso-639, and the next-rails lockfile does not get it at all, so the app fails to boot there with "cannot load such file -- csv". No version change on the current bundle: Gemfile.lock keeps csv 3.3.5 and only gains the top-level dependency.
Gemfile.next.lock had drifted from Gemfile.lock since next_rails was introduced: it still resolved factory_bot 6.2.0, which requires "observer" (no longer a default gem in Ruby 3.4), and it predates the connection_pool "< 3" pin. Under Ruby 3.4 the next bundle could not boot. The lock is rebuilt the way next_rails recommends: copy Gemfile.lock, then update rails conservatively, so every other gem stays on the version the main bundle already runs. The next Rails constraint becomes "~> 8.0.0" so this step stays on Rails 8.0 (now 8.0.5.1) instead of jumping to 8.1; moving to 8.1 can be a separate step.
A singular resource has no index action. Rails 7.2 ignored it, but Rails 8.0 raises at boot: "Route `resource :contact` - :only and :except must include only [:show, :create, :update, :destroy, :new, :edit], but also included [:index]". No side effects: `rails routes` produces the identical route table on Rails 7.2 before and after this change.
|
Not sure how you ended up with 8.0.5 but pinning rails to Thanks for your contribution anyway! |
|
Thanks for taking this over in #3843, and for keeping me as co-author, much appreciated. You're right about the lock. I copied Gemfile.lock to Gemfile.next.lock and then ran If it helps, I'm happy to do the Rails 8.1 step for the next bundle as a separate PR once #3843 is in, changing only rails and what it requires. |
Checklist
masterbranch.Short description of what this resolves/which issues does this fix?:
BUNDLE_GEMFILE=Gemfile.nexton Ruby 3.4.10 the app does not boot, so the Next-railsworkflow cannot get past
db:setup. Three independent causes, one commit each:cannot load such file -- csv: csv is a bundled (not default) gem since Ruby 3.4 and theGemfile never declared it; the current lockfile only gets it through iso-639.
cannot load such file -- observer: Gemfile.next.lock had drifted from Gemfile.lock(factory_bot 6.2.0, missing the
connection_pool < 3pin).resource :contact, except: [:index, ...]because a singular resourcehas no index action (7.2 ignored it).
Changes proposed in this pull request:
gem 'csv'. Gemfile.lock keeps csv 3.3.5 and only gains the top-level dependency.railsupdate, and pin the nextconstraint to
~> 8.0.0so this step lands on Rails 8.0 (8.0.5.1) rather than 8.1.:indexfrom the singularcontactresource.rails routesoutput is identical on 7.2before and after.
How it was tested (Docker: ruby:3.4.10 + postgres:16-alpine, same suites as the workflows):
Note: Rails 8.0 security support ends on 2026-11-07, so moving next to 8.1 would be a sensible
follow-up; happy to open that separately if useful.