Skip to content

Commit

Permalink
Require logger before running Rails commands (#1149)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
etiennebarrie authored Jan 21, 2025
1 parent 14c7c69 commit c95d481
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 3 additions & 0 deletions bin/rails
Original file line number Diff line number Diff line change
Expand Up @@ -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"
3 changes: 3 additions & 0 deletions test/dummy/Rakefile
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions test/dummy/bin/rails
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit c95d481

Please sign in to comment.