← strona głównaProgramowanie (Програмування)

[Fixed] niezainicjowana stała ActiveSupport::LoggerThreadSafeLevel::Logger (NameError)

Poprawka błędu ActiveSupport po aktualizacji PaperTrail: konflikt z concurrent-ruby. Rozwiązanie — zainstalować wersję 1.3.4.

Ta treść została automatycznie przetłumaczona z ukraińskiego.
Naprawa błędu po zainstalowaniu najnowszej wersji paper_trail:
uninitialized constant ActiveSupport::LoggerThreadSafeLevel::Logger (NameError)
~/Desktop/sandbox rails c                      
/Users/user/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activesupport-7.0.4.3/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 /Users/user/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activesupport-7.0.4.3/lib/active_support/logger_thread_safe_level.rb:9:in `<module:ActiveSupport>'
from /Users/user/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activesupport-7.0.4.3/lib/active_support/logger_thread_safe_level.rb:8:in `<main>'
from /Users/user/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
from /Users/user/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
from /Users/user/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activesupport-7.0.4.3/lib/active_support/logger_silence.rb:5:in `<main>'
from /Users/user/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
from /Users/user/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
from /Users/user/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activesupport-7.0.4.3/lib/active_support/logger.rb:3:in `<main>'
from /Users/user/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
from /Users/user/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
from /Users/user/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activesupport-7.0.4.3/lib/active_support.rb:29:in `<main>'
from /Users/user/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
from /Users/user/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
from /Users/user/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.0.4.3/lib/rails/command.rb:3:in `<main>'
from /Users/user/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
from /Users/user/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
from /Users/user/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.0.4.3/lib/rails/commands.rb:3:in `<main>'
from /Users/user/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
from /Users/user/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
from bin/rails:4:in `<main>'
Usuwamy wszystkie istniejące biblioteki concurrent-ruby
gem uninstall concurrent-ruby
I instalujemy dokładnie 1.3.4 (1.3.5 również powoduje błąd).
Dodaj do Gemfile:
gem 'concurrent-ruby', '1.3.4'
I jak zawsze, bundle install
Po tym błędy znikają. Wyjaśnienie tego błędu można znaleźć w pull requestach i problemach biblioteki na GitHubie.
~/Desktop/sandbox rails c                      
Loading development environment (Rails 7.0.4.3)
irb(main):001:0> 

🔥 Więcej postów

Wszystkie wpisy
Co to jest vibe coding?
25 lip '25 21:51

Co to jest vibe coding?

Wib-kodowanie to intuicyjne programowanie w tandemie z AI: bez surowych zasad, z muzyką, inspirac...