From b5e9878550326d4f2478054d6fec52c8ae0d43ec Mon Sep 17 00:00:00 2001 From: Sean Healy Date: Mon, 6 Jul 2026 15:05:43 +0100 Subject: [PATCH] Upgrade Rails to 7.2.3.1 and fix boot-time logger NameError 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) --- rails/Gemfile | 4 +- rails/Gemfile.lock | 222 ++++++++++++++--------- rails/config/application.rb | 2 +- rails/config/boot.rb | 1 + rails/config/environments/development.rb | 2 +- rails/test/test_helper.rb | 2 +- 6 files changed, 139 insertions(+), 94 deletions(-) diff --git a/rails/Gemfile b/rails/Gemfile index fa8f88e..322eac6 100644 --- a/rails/Gemfile +++ b/rails/Gemfile @@ -1,7 +1,7 @@ source 'https://rubygems.org' -ruby '>= 3.0' +ruby '>= 3.1' -gem 'rails', '7.0.8.1' +gem 'rails', '7.2.3.1' gem 'bundler' diff --git a/rails/Gemfile.lock b/rails/Gemfile.lock index 17532b6..9107e1f 100644 --- a/rails/Gemfile.lock +++ b/rails/Gemfile.lock @@ -1,83 +1,103 @@ GEM remote: https://rubygems.org/ specs: - actioncable (7.0.8.1) - actionpack (= 7.0.8.1) - activesupport (= 7.0.8.1) + actioncable (7.2.3.1) + actionpack (= 7.2.3.1) + activesupport (= 7.2.3.1) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (7.0.8.1) - actionpack (= 7.0.8.1) - activejob (= 7.0.8.1) - activerecord (= 7.0.8.1) - activestorage (= 7.0.8.1) - activesupport (= 7.0.8.1) - mail (>= 2.7.1) - net-imap - net-pop - net-smtp - actionmailer (7.0.8.1) - actionpack (= 7.0.8.1) - actionview (= 7.0.8.1) - activejob (= 7.0.8.1) - activesupport (= 7.0.8.1) - mail (~> 2.5, >= 2.5.4) - net-imap - net-pop - net-smtp - rails-dom-testing (~> 2.0) - actionpack (7.0.8.1) - actionview (= 7.0.8.1) - activesupport (= 7.0.8.1) - rack (~> 2.0, >= 2.2.4) + zeitwerk (~> 2.6) + actionmailbox (7.2.3.1) + actionpack (= 7.2.3.1) + activejob (= 7.2.3.1) + activerecord (= 7.2.3.1) + activestorage (= 7.2.3.1) + activesupport (= 7.2.3.1) + mail (>= 2.8.0) + actionmailer (7.2.3.1) + actionpack (= 7.2.3.1) + actionview (= 7.2.3.1) + activejob (= 7.2.3.1) + activesupport (= 7.2.3.1) + mail (>= 2.8.0) + rails-dom-testing (~> 2.2) + actionpack (7.2.3.1) + actionview (= 7.2.3.1) + activesupport (= 7.2.3.1) + cgi + nokogiri (>= 1.8.5) + racc + rack (>= 2.2.4, < 3.3) + rack-session (>= 1.0.1) rack-test (>= 0.6.3) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (7.0.8.1) - actionpack (= 7.0.8.1) - activerecord (= 7.0.8.1) - activestorage (= 7.0.8.1) - activesupport (= 7.0.8.1) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + useragent (~> 0.16) + actiontext (7.2.3.1) + actionpack (= 7.2.3.1) + activerecord (= 7.2.3.1) + activestorage (= 7.2.3.1) + activesupport (= 7.2.3.1) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.0.8.1) - activesupport (= 7.0.8.1) + actionview (7.2.3.1) + activesupport (= 7.2.3.1) builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (7.0.8.1) - activesupport (= 7.0.8.1) + cgi + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + activejob (7.2.3.1) + activesupport (= 7.2.3.1) globalid (>= 0.3.6) - activemodel (7.0.8.1) - activesupport (= 7.0.8.1) - activerecord (7.0.8.1) - activemodel (= 7.0.8.1) - activesupport (= 7.0.8.1) - activestorage (7.0.8.1) - actionpack (= 7.0.8.1) - activejob (= 7.0.8.1) - activerecord (= 7.0.8.1) - activesupport (= 7.0.8.1) + activemodel (7.2.3.1) + activesupport (= 7.2.3.1) + activerecord (7.2.3.1) + activemodel (= 7.2.3.1) + activesupport (= 7.2.3.1) + timeout (>= 0.4.0) + activestorage (7.2.3.1) + actionpack (= 7.2.3.1) + activejob (= 7.2.3.1) + activerecord (= 7.2.3.1) + activesupport (= 7.2.3.1) marcel (~> 1.0) - mini_mime (>= 1.1.0) - activesupport (7.0.8.1) - concurrent-ruby (~> 1.0, >= 1.0.2) + activesupport (7.2.3.1) + base64 + benchmark (>= 0.3) + bigdecimal + concurrent-ruby (~> 1.0, >= 1.3.1) + connection_pool (>= 2.2.5) + drb i18n (>= 1.6, < 2) - minitest (>= 5.1) - tzinfo (~> 2.0) + logger (>= 1.4.2) + minitest (>= 5.1, < 6) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) base64 (0.3.0) + benchmark (0.5.0) + bigdecimal (4.1.2) builder (3.3.0) + cgi (0.5.2) coderay (1.1.3) concurrent-ruby (1.3.7) - crass (1.0.6) + connection_pool (3.0.2) + crass (1.0.7) date (3.5.1) + drb (2.2.3) + erb (6.0.4) erubi (1.13.1) execjs (2.8.1) - globalid (1.3.0) + globalid (1.4.0) activesupport (>= 6.1) - i18n (1.14.8) + i18n (1.15.2) concurrent-ruby (~> 1.0) + io-console (0.8.2) + irb (1.18.0) + pp (>= 0.6.0) + prism (>= 1.3.0) + rdoc (>= 4.0.0) + reline (>= 0.4.2) jquery-rails (4.6.0) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) @@ -86,18 +106,17 @@ GEM loofah (2.25.1) crass (~> 1.0.2) nokogiri (>= 1.12.0) - mail (2.9.0) + mail (2.9.1) logger mini_mime (>= 0.1.1) net-imap net-pop net-smtp - marcel (1.1.0) + marcel (1.2.1) method_source (1.1.0) mini_mime (1.1.5) mini_portile2 (2.8.9) - minitest (6.0.1) - prism (~> 1.5) + minitest (5.27.0) net-imap (0.6.4.1) date net-protocol @@ -111,6 +130,9 @@ GEM nokogiri (1.19.4) mini_portile2 (~> 2.8.2) racc (~> 1.4) + pp (0.6.4) + prettyprint + prettyprint (0.2.0) prism (1.9.0) pry (0.14.2) coderay (~> 1.1) @@ -118,38 +140,58 @@ GEM puma (7.2.1) nio4r (~> 2.0) racc (1.8.1) - rack (2.2.23) + rack (3.2.6) + rack-session (2.1.2) + base64 (>= 0.1.0) + rack (>= 3.0.0) rack-test (2.2.0) rack (>= 1.3) - rails (7.0.8.1) - actioncable (= 7.0.8.1) - actionmailbox (= 7.0.8.1) - actionmailer (= 7.0.8.1) - actionpack (= 7.0.8.1) - actiontext (= 7.0.8.1) - actionview (= 7.0.8.1) - activejob (= 7.0.8.1) - activemodel (= 7.0.8.1) - activerecord (= 7.0.8.1) - activestorage (= 7.0.8.1) - activesupport (= 7.0.8.1) + rackup (2.3.1) + rack (>= 3) + rails (7.2.3.1) + actioncable (= 7.2.3.1) + actionmailbox (= 7.2.3.1) + actionmailer (= 7.2.3.1) + actionpack (= 7.2.3.1) + actiontext (= 7.2.3.1) + actionview (= 7.2.3.1) + activejob (= 7.2.3.1) + activemodel (= 7.2.3.1) + activerecord (= 7.2.3.1) + activestorage (= 7.2.3.1) + activesupport (= 7.2.3.1) bundler (>= 1.15.0) - railties (= 7.0.8.1) + railties (= 7.2.3.1) rails-dom-testing (2.3.0) activesupport (>= 5.0.0) minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.6.2) - loofah (~> 2.21) + rails-html-sanitizer (1.7.0) + loofah (~> 2.25) nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) - railties (7.0.8.1) - actionpack (= 7.0.8.1) - activesupport (= 7.0.8.1) - method_source + railties (7.2.3.1) + actionpack (= 7.2.3.1) + activesupport (= 7.2.3.1) + cgi + irb (~> 1.13) + rackup (>= 1.0.0) rake (>= 12.2) - thor (~> 1.0) - zeitwerk (~> 2.5) - rake (13.3.1) + thor (~> 1.0, >= 1.2.2) + tsort (>= 0.2) + zeitwerk (~> 2.6) + rake (13.4.2) + rbs (4.0.3) + logger + prism (>= 1.6.0) + tsort + rdoc (8.0.0) + erb + prism (>= 1.6.0) + rbs (>= 4.0.0) + tsort + reline (0.6.3) + io-console (~> 0.5) + securerandom (0.4.1) sprockets (4.2.0) concurrent-ruby (~> 1.0) rack (>= 2.2.4, < 4) @@ -161,15 +203,17 @@ GEM mini_portile2 (~> 2.8.0) thor (1.5.0) timeout (0.6.1) + tsort (0.2.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) uglifier (4.2.0) execjs (>= 0.3.0, < 3) - websocket-driver (0.8.0) + useragent (0.16.11) + websocket-driver (0.8.2) base64 websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) - zeitwerk (2.7.4) + zeitwerk (2.8.2) PLATFORMS ruby @@ -179,7 +223,7 @@ DEPENDENCIES jquery-rails pry puma - rails (= 7.0.8.1) + rails (= 7.2.3.1) sprockets-rails sqlite3 tzinfo-data diff --git a/rails/config/application.rb b/rails/config/application.rb index 3a20be8..278ff56 100644 --- a/rails/config/application.rb +++ b/rails/config/application.rb @@ -9,7 +9,7 @@ module Minicom class Application < Rails::Application # Initialize configuration defaults for originally generated Rails version. - config.load_defaults 7.0 + config.load_defaults 7.2 # Settings in config/environments/* take precedence over those specified here. # Application configuration can go into files in config/initializers diff --git a/rails/config/boot.rb b/rails/config/boot.rb index 4423c97..2ebc4ff 100644 --- a/rails/config/boot.rb +++ b/rails/config/boot.rb @@ -1,4 +1,5 @@ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) +require 'logger' require 'bundler/setup' # Set up gems listed in the Gemfile. # require 'bootsnap/setup' # Speed up boot time by caching expensive operations. diff --git a/rails/config/environments/development.rb b/rails/config/environments/development.rb index d3e4931..986a58b 100644 --- a/rails/config/environments/development.rb +++ b/rails/config/environments/development.rb @@ -6,7 +6,7 @@ # In the development environment your application's code is reloaded on # every request. This slows down response time but is perfect for development # since you don't have to restart the web server when you make code changes. - config.cache_classes = false + config.enable_reloading = true # Do not eager load code on boot. config.eager_load = false diff --git a/rails/test/test_helper.rb b/rails/test/test_helper.rb index bc7e05d..e3bf7c7 100644 --- a/rails/test/test_helper.rb +++ b/rails/test/test_helper.rb @@ -3,7 +3,7 @@ require 'rails/test_help' class ActiveSupport::TestCase - ActiveRecord::Migration.check_pending! + ActiveRecord::Migration.check_all_pending! # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. #