我已经将sidekiq gem更新为5.0.4,现在我运行服务器时出现此错误。
NameError: uninitialized constant Sidekiq::Extensions::ActionMailer
/Users/mike/Documents/paycar/back_end/config/initializers/mail.rb:15:in `<top (required)>'
/Users/mike/.rvm/gems/ruby-2.3.1@paycar-api/gems/railties-4.2.7.1/lib/rails/engine.rb:652:in `block in load_config_initializer'
/Users/mike/.rvm/gems/ruby-2.3.1@paycar-api/gems/activesupport-4.2.7.1/lib/active_support/notifications.rb:166:in `instrument'
/Users/mike/.rvm/gems/ruby-2.3.1@paycar-api/gems/railties-4.2.7.1/lib/rails/engine.rb:651:in `load_config_initializer'
/Users/mike/.rvm/gems/ruby-2.3.1@paycar-api/gems/railties-4.2.7.1/lib/rails/engine.rb:616:in `block (2 levels) in <class:Engine>'
/Users/mike/.rvm/gems/ruby-2.3.1@paycar-api/gems/railties-4.2.7.1/lib/rails/engine.rb:615:in `each'
/Users/mike/.rvm/gems/ruby-2.3.1@paycar-api/gems/railties-4.2.7.1/lib/rails/engine.rb:615:in `block in <class:Engine>'
/Users/mike/.rvm/gems/ruby-2.3.1@paycar-api/gems/railties-4.2.7.1/lib/rails/initializable.rb:30:in `instance_exec'
/Users/mike/.rvm/gems/ruby-2.3.1@paycar-api/gems/railties-4.2.7.1/lib/rails/initializable.rb:30:in `run'
/Users/mike/.rvm/gems/ruby-2.3.1@paycar-api/gems/railties-4.2.7.1/lib/rails/initializable.rb:55:in `block in run_initializers'
/Users/mike/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:228:in `block in tsort_each'
/Users/mike/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
/Users/mike/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'
/Users/mike/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:431:in `each_strongly_connected_component_from'
/Users/mike/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:421:in `block in each_strongly_connected_component_from'
/Users/mike/.rvm/gems/ruby-2.3.1@paycar-api/gems/railties-4.2.7.1/lib/rails/initializable.rb:44:in `each'
/Users/mike/.rvm/gems/ruby-2.3.1@paycar-api/gems/railties-4.2.7.1/lib/rails/initializable.rb:44:in `tsort_each_child'
/Users/mike/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:415:in `call'
/Users/mike/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:415:in `each_strongly_connected_component_from'
/Users/mike/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:349:in `block in each_strongly_connected_component'
/Users/mike/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:347:in `each'
/Users/mike/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:347:in `call'
/Users/mike/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:347:in `each_strongly_connected_component'
/Users/mike/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:226:in `tsort_each'
/Users/mike/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:205:in `tsort_each'
/Users/mike/.rvm/gems/ruby-2.3.1@paycar-api/gems/railties-4.2.7.1/lib/rails/initializable.rb:54:in `run_initializers'
/Users/mike/.rvm/gems/ruby-2.3.1@paycar-api/gems/railties-4.2.7.1/lib/rails/application.rb:352:in `initialize!'
/Users/mike/Documents/paycar/back_end/config/environment.rb:6:in `<top (required)>'
/Users/mike/Documents/paycar/back_end/spec/rails_helper.rb:5:in `require'
/Users/mike/Documents/paycar/back_end/spec/rails_helper.rb:5:in `<top (required)>'
/Users/mike/Documents/paycar/back_end/spec/controllers/api/csrf_controller_spec.rb:2:in `require'
/Users/mike/Documents/paycar/back_end/spec/controllers/api/csrf_controller_spec.rb:2:in `<top (required)>'
/Users/mike/.rvm/gems/ruby-2.3.1@paycar-api/gems/rspec-core-3.2.3/lib/rspec/core/configuration.rb:1226:in `load'
/Users/mike/.rvm/gems/ruby-2.3.1@paycar-api/gems/rspec-core-3.2.3/lib/rspec/core/configuration.rb:1226:in `block in load_spec_files'
/Users/mike/.rvm/gems/ruby-2.3.1@paycar-api/gems/rspec-core-3.2.3/lib/rspec/core/configuration.rb:1224:in `each'
/Users/mike/.rvm/gems/ruby-2.3.1@paycar-api/gems/rspec-core-3.2.3/lib/rspec/core/configuration.rb:1224:in `load_spec_files'
/Users/mike/.rvm/gems/ruby-2.3.1@paycar-api/gems/rspec-core-3.2.3/lib/rspec/core/runner.rb:97:in `setup'
/Users/mike/.rvm/gems/ruby-2.3.1@paycar-api/gems/rspec-core-3.2.3/lib/rspec/core/runner.rb:85:in `run'
/Users/mike/.rvm/gems/ruby-2.3.1@paycar-api/gems/rspec-core-3.2.3/lib/rspec/core/runner.rb:70:in `run'
/Users/mike/.rvm/gems/ruby-2.3.1@paycar-api/gems/rspec-core-3.2.3/lib/rspec/core/runner.rb:38:in `invoke'
/Users/mike/.rvm/gems/ruby-2.3.1@paycar-api/gems/rspec-core-3.2.3/exe/rspec:4:in `<top (required)>'
/Users/mike/.rvm/gems/ruby-2.3.1@paycar-api/bin/rspec:22:in `load'
/Users/mike/.rvm/gems/ruby-2.3.1@paycar-api/bin/rspec:22:in `<top (required)>'
现在在mail.rb第15行就是这个 :: MandrillMailer :: TemplateMailer.extend(Sidekiq ::扩展::的ActionMailer)
我尝试添加config.eager_loading = true
并尝试添加类config.autoload_paths
,但这没有帮助。
非常感谢任何帮助。
答案 0 :(得分:1)
这可能是文件订购的事情。您可以看到Sidekiq::Extensions::ActionMailer
定义为require 'sidekiq/extensions/action_mailer'
。也许尝试在顶部添加|L1 | L2 | L3 | L4 | L5 |
|---| --- | ---|--- |--- |
|192| 168 | 144| 120| 96 |
行?
答案 1 :(得分:0)
请参阅&#34;延迟扩展...&#34;
https://github.com/mperham/sidekiq/blob/master/5.0-Upgrade.md#whats-new