You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/home/fernando/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/logging-rails-0.6.0/lib/logging/rails/railtie.rb:18:in block in <class:Railtie>': undefined method exists?' for File:Class (NoMethodError)
load file if File.exists? file
^^^^^^^^
Did you mean? exist?
from /home/fernando/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/railties-7.0.8.1/lib/rails/initializable.rb:32:in `instance_exec'
I am using 0.6.0 of this gem + rails 7.0.8.1 and ruby 3.2.2
I think the exists is removed from ruby 3.0.0 / rails 7.
The text was updated successfully, but these errors were encountered:
fernandoiwamoto
changed the title
For Ruby 3.2.2 undefined method `exists?' for File:Class (NoMethodError)
For Ruby 3.2.2 and Rails 7 undefined method `exists?' for File:Class (NoMethodError)
May 9, 2024
# frozen_string_literal: truerequire'logging/rails/railtie'moduleLoggingRailtiePatchdefself.override_initializer!Logging::Rails::Railtie.class_evaldo# Remove the existing initializerinitializers.delete_if{ |initializer| initializer.name == 'logging.configure'}# Add the new initializerinitializer'logging.configure',before: 'initialize_logger'do |app|
file= ::Rails.root.join('config/logging.rb')loadfileifFile.exist?file
::Logging::Rails.configuration&.call(app.config)endendendendLoggingRailtiePatch.override_initializer!
config/application.rb:
# frozen_string_literal: truerequire_relative'boot'require'rails'# ...Bundler.require(*Rails.groups)# Import patch after bundler and before app initrequireFile.expand_path('../lib/logging_railtie_patch',__dir__)classApplication < Rails::Application# ...end
/home/fernando/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/logging-rails-0.6.0/lib/logging/rails/railtie.rb:18:in
block in <class:Railtie>': undefined method
exists?' for File:Class (NoMethodError)Did you mean? exist?
from /home/fernando/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/railties-7.0.8.1/lib/rails/initializable.rb:32:in `instance_exec'
I am using 0.6.0 of this gem + rails 7.0.8.1 and ruby 3.2.2
I think the
exists
is removed from ruby 3.0.0 / rails 7.The text was updated successfully, but these errors were encountered: