Skip to content

uninitialized constant ActiveSupport::LoggerThreadSafeLevel::Logger (NameError) on Rails 7.0.8.7 and concurrent-ruby 1.3.5 #54271

@ttstarck

Description

@ttstarck

Yesterday, concurrent-ruby gem released version 1.3.5 which removed logger as a dependency as well as removed a line that required logger: 1.3.4 vs 1.3.5

It seems that this has caused ActiveSupport to fail to load on require with the following error:

/usr/local/bundle/gems/activesupport-7.0.8.7/lib/active_support/logger_thread_safe_level.rb:12:in `<module:LoggerThreadSafeLevel>': uninitialized constant ActiveSupport::LoggerThreadSafeLevel::Logger (NameError)
 
    Logger::Severity.constants.each do |severity|
    ^^^^^^
	from /usr/local/bundle/gems/activesupport-7.0.8.7/lib/active_support/logger_thread_safe_level.rb:9:in `<module:ActiveSupport>'
	from /usr/local/bundle/gems/activesupport-7.0.8.7/lib/active_support/logger_thread_safe_level.rb:8:in `<top (required)>'
	from <internal:/usr/local/lib/ruby/site_ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
	from <internal:/usr/local/lib/ruby/site_ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
	from /usr/local/bundle/gems/activesupport-7.0.8.7/lib/active_support/logger_silence.rb:5:in `<top (required)>'
	from <internal:/usr/local/lib/ruby/site_ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
	from <internal:/usr/local/lib/ruby/site_ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
	from /usr/local/bundle/gems/activesupport-7.0.8.7/lib/active_support/logger.rb:3:in `<top (required)>'
	from <internal:/usr/local/lib/ruby/site_ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
	from <internal:/usr/local/lib/ruby/site_ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
	from /usr/local/bundle/gems/activesupport-7.0.8.7/lib/active_support.rb:29:in `<top (required)>'
	from <internal:/usr/local/lib/ruby/site_ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
	from <internal:/usr/local/lib/ruby/site_ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
	from /usr/local/bundle/gems/invoca_secrets-1.4.0/lib/invoca_secrets/stores/vault.rb:3:in `<top (required)>'
	from <internal:/usr/local/lib/ruby/site_ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
	from <internal:/usr/local/lib/ruby/site_ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:136:in `require'

Steps to Reproduce

  1. Create a Gemfile with the following:
# frozen_string_literal: true
             
source "https://rubygems.org"    
                                 
gem 'concurrent-ruby', '1.3.5'   
gem 'rails', '7.0.8.7'   
  1. Run the following:
bundle exec ruby -e 'require "active_support"'

Current Workaround

Manually require logger before attempting to require active_support

require "logger"
require "active_support"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions