Upgrade Rails to 7.2.3.1 and fix boot-time logger NameError#83
Conversation
On a clean checkout, `script/rails/setup` failed during boot with
`NameError: uninitialized constant ActiveSupport::LoggerThreadSafeLevel::Logger`.
concurrent-ruby 1.3.5+ dropped its implicit `logger` require, and Rails 7.0.x
referenced `Logger` at load time without requiring Ruby's stdlib logger first.
Rather than only patch 7.0, move off the end-of-life 7.0 line to 7.2.3.1
(Ruby 3.2.2 satisfies its >= 3.1 floor). ActiveSupport fixed the logger require
upstream in the 7.1.x line, so the bump alone resolves the NameError; an explicit
`require 'logger'` is kept in boot.rb as a zero-cost defensive guard.
- Gemfile: rails 7.0.8.1 -> 7.2.3.1, ruby >= 3.0 -> >= 3.1
- application.rb: load_defaults 7.0 -> 7.2
- boot.rb: add require 'logger'
- development.rb: cache_classes -> enable_reloading (7.1+ deprecation)
- test_helper.rb: check_pending! -> check_all_pending! (removed in Rails 7.1)
Verified: script/rails/setup completes, bin/rails test loads clean, and both
POST /foo and POST /bar return {"success":true}.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
Context
On a clean checkout,
script/rails/setupfailed during Rails boot with:concurrent-ruby1.3.5+ dropped its implicitloggerrequire (the lockfile pins1.3.7), and Rails 7.0.x referencedLoggerat load time without first requiring Ruby's stdlib logger.Rather than only patch the 7.0 line — which is end-of-life — this moves to Rails 7.2.3.1. Local Ruby (3.2.2) satisfies 7.2's
>= 3.1floor. ActiveSupport fixed the logger require upstream during the 7.1.x line, so the bump alone resolves theNameError; an explicitrequire 'logger'is kept inboot.rbas a zero-cost defensive guard.Changes
rails/Gemfilerails7.0.8.1 → 7.2.3.1;ruby '>= 3.0'→'>= 3.1'rails/config/application.rbconfig.load_defaults 7.0→7.2rails/config/boot.rbrequire 'logger'rails/config/environments/development.rbconfig.cache_classes = false→config.enable_reloading = true(silences 7.1+ deprecation)rails/test/test_helper.rbcheck_pending!→check_all_pending!(former removed in Rails 7.1)rails/Gemfile.lockbundle update railsNotable: the resolver downgraded
minitest6.0.1 → 5.27.0 to satisfy activesupport 7.2.3.1'sminitest (>= 5.1, < 6)constraint. Thetest_helper.rbfix was required becauseActiveRecord::Migration.check_pending!(removed in 7.1) made the test suite fail to load under 7.2.Verification
script/rails/setupcompletes with noNameErrorbundle exec rails --version→Rails 7.2.3.1bin/rails test→ 0 failures, 0 errors (loads cleanly)POST /fooandPOST /barboth return{"success":true}🤖 Generated with Claude Code