升级到Rails 5.0.0.1后{uninitialized constant Sidekiq :: Rails :: Reloader`

时间:2016-11-29 09:49:17

标签: ruby-on-rails ruby-on-rails-5 sidekiq

我刚刚从Rails 4.2.6升级到Rails 5.0.0.1。我在config/routes.rb中为Sidekiq UI配置了以下配置:

if Rails.application.queuing_enabled?
  require 'sidekiq/web'
  Sidekiq::Web.set :session_secret, Rails.application.secrets[:secret_key_base]

  authenticate :user, ->(u) { u.admin? } do
    mount Sidekiq::Web => '/sidekiq'
  end
end

Rails.application.queuing_enabled?模式下,true的值始终为productionfalsedevelopment中为test

升级后,我在本地运行任何内容时遇到以下错误(尝试运行rspecrails middleware等):

rails aborted!
NameError: uninitialized constant Sidekiq::Rails::Reloader
/home/project/config/routes.rb:66:in `block in <top (required)>'
/home/project/config/routes.rb:2:in `<top (required)>'
/home/project/config/environment.rb:6:in `<top (required)>'
/home/project/bin/rails:9:in `require'
/home/project/bin/rails:9:in `<top (required)>'
/home/project/bin/spring:13:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'
Tasks: TOP => middleware => environment
(See full trace by running task with --trace)

我的Gemfile.lock为Sidekiq提供了以下版本信息。

sidekiq (4.2.7)
  concurrent-ruby (~> 1.0)
  connection_pool (~> 2.2, >= 2.2.0)
  rack-protection (>= 1.5.0)
  redis (~> 3.2, >= 3.2.1)
sidekiq-limit_fetch (3.4.0)
  sidekiq (>= 4)

非常感谢任何帮助。谢谢!

1 个答案:

答案 0 :(得分:0)

显然,这是Sidekiq 4.2.7的一个错误,将在下一个版本中解决。

有关详细信息,请参阅https://github.com/mperham/sidekiq/issues/3275