我刚刚从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
的值始终为production
,false
和development
中为test
。
升级后,我在本地运行任何内容时遇到以下错误(尝试运行rspec
,rails 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)
非常感谢任何帮助。谢谢!
答案 0 :(得分:0)
显然,这是Sidekiq 4.2.7的一个错误,将在下一个版本中解决。