From c95d4814a1ded578b91f73e366664e16c8832bc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20Barri=C3=A9?= Date: Tue, 21 Jan 2025 15:32:16 +0100 Subject: [PATCH] Require logger before running Rails commands (#1149) This is only necessary because concurrent-ruby 1.6.5 doesn't require "logger" anymore and ActiveSupport::LoggerThreadSafeLevel < 7.1 references Logger without requiring it first. --- Rakefile | 3 +++ bin/rails | 3 +++ test/dummy/Rakefile | 3 +++ test/dummy/bin/rails | 4 ++++ 4 files changed, 13 insertions(+) diff --git a/Rakefile b/Rakefile index 0714cadc6..fcd8e4da6 100644 --- a/Rakefile +++ b/Rakefile @@ -6,6 +6,9 @@ rescue LoadError puts "You must `gem install bundler` and `bundle install` to run rake tasks" end +# Only necessary for activesupport <= 7.0 and concurrent-ruby >= 1.3.5 +require "logger" # https://github.com/rails/rails/issues/54260 + require "rdoc/task" RDoc::Task.new(:rdoc) do |rdoc| rdoc.rdoc_dir = "rdoc" diff --git a/bin/rails b/bin/rails index 855cf948e..6ec218a0d 100755 --- a/bin/rails +++ b/bin/rails @@ -12,4 +12,7 @@ APP_PATH = File.expand_path("../test/dummy/config/application", __dir__) ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) require "bundler/setup" if File.exist?(ENV["BUNDLE_GEMFILE"]) +# Only necessary for activesupport <= 7.0 and concurrent-ruby >= 1.3.5 +require "logger" # https://github.com/rails/rails/issues/54260 + require "rails/engine/commands" diff --git a/test/dummy/Rakefile b/test/dummy/Rakefile index c4f952387..b2724102d 100644 --- a/test/dummy/Rakefile +++ b/test/dummy/Rakefile @@ -1,5 +1,8 @@ # frozen_string_literal: true +# Only necessary for activesupport <= 7.0 and concurrent-ruby >= 1.3.5 +require "logger" # https://github.com/rails/rails/issues/54260 + require_relative "config/application" Rails.application.load_tasks diff --git a/test/dummy/bin/rails b/test/dummy/bin/rails index 22f2d8dee..d1eacd170 100755 --- a/test/dummy/bin/rails +++ b/test/dummy/bin/rails @@ -3,4 +3,8 @@ APP_PATH = File.expand_path("../config/application", __dir__) require_relative "../config/boot" + +# Only necessary for activesupport <= 7.0 and concurrent-ruby >= 1.3.5 +require "logger" # https://github.com/rails/rails/issues/54260 + require "rails/commands"