Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoMethodError: undefined method `logger' for nil:NilClass #191

Open
ashish-infogain opened this issue Aug 12, 2022 · 1 comment
Open

NoMethodError: undefined method `logger' for nil:NilClass #191

ashish-infogain opened this issue Aug 12, 2022 · 1 comment

Comments

@ashish-infogain
Copy link

ashish-infogain commented Aug 12, 2022

I am using sequel-rails -1.2.0 In multiple rails applications with sequel gem version(5.43.0). But when I am going to start the application or do rake db:migrate then I am getting the above issue.

here I found that the issue is coming from lib/sequel_rails/railties/log_subscriber.rb:64

Caused by: NoMethodError: undefined method logger' for nil:NilClass
/home/travis/build/projectdx/es_indexer/vendor/bundle/ruby/2.5.0/gems/sequel-rails-1.2.0/lib/sequel_rails/railties/log_subscriber.rb:64:in logger' /home/travis/build/projectdx/es_indexer/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.8.1/lib/active_support/log_subscriber.rb:80:in start'
/home/travis/build/projectdx/es_indexer/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.8.1/lib/active_support/notifications/fanout.rb:100:in start' /home/travis/build/projectdx/es_indexer/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.8.1/lib/active_support/notifications/fanout.rb:44:in block in start'
/home/travis/build/projectdx/es_indexer/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.8.1/lib/active_support/notifications/fanout.rb:44:in each' /home/travis/build/projectdx/es_indexer/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.8.1/lib/active_support/notifications/fanout.rb:44:in start'
/home/travis/build/projectdx/es_indexer/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.8.1/lib/active_support/notifications/instrumenter.rb:35:in start' /home/travis/build/projectdx/es_indexer/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.8.1/lib/active_support/notifications/instrumenter.rb:21:in instrument'
/home/travis/build/projectdx/es_indexer/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.8.1/lib/active_support/notifications.rb:168:in instrument' /home/travis/build/projectdx/es_indexer/vendor/bundle/ruby/2.5.0/gems/sequel-rails-1.2.0/lib/sequel_rails/sequel/database/active_support_notification.rb:11:in log_connection_yield'`

@opensourceame
Copy link

For anyone still experiencing this, you can fix it like this:

SequelRails.configuration = OpenStruct.new(logger: Logger.new($stdout))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants