Sidekiq中未初始化的常量

时间:2018-04-27 07:34:08

标签: ruby-on-rails ruby sidekiq

在工人中出现错误NameError: uninitialized constant DeliveryWorker sidekiq日志中的错误

NameError: uninitialized constant DeliveryWorker
2018-04-27T07:39:47.163Z 8323 TID-1uztxc WARN: /home/parts-soft/.rvm/gems/ruby-2.0.0-p247@parts-script-new-admin/gems/activesupport-3.2.13/lib/active_support/inflector/methods.rb:230:in `block in constantize'
/home/parts-soft/.rvm/gems/ruby-2.0.0-p247@parts-script-new-admin/gems/activesupport-3.2.13/lib/active_support/inflector/methods.rb:229:in `each'
/home/parts-soft/.rvm/gems/ruby-2.0.0-p247@parts-script-new-admin/gems/activesupport-3.2.13/lib/active_support/inflector/methods.rb:229:in `constantize'
/home/parts-soft/.rvm/gems/ruby-2.0.0-p247@parts-script-new-admin/gems/activesupport-3.2.13/lib/active_support/core_ext/string/inflections.rb:54:in `constantize'
/home/parts-soft/.rvm/gems/ruby-2.0.0-p247@parts-script-new-admin/gems/sidekiq-3.5.4/lib/sidekiq/processor.rb:46:in `process'
/home/parts-soft/.rvm/gems/ruby-2.0.0-p247@parts-script-new-admin/gems/celluloid-0.17.3/lib/celluloid/calls.rb:28:in `public_send'
/home/parts-soft/.rvm/gems/ruby-2.0.0-p247@parts-script-new-admin/gems/celluloid-0.17.3/lib/celluloid/calls.rb:28:in `dispatch'
/home/parts-soft/.rvm/gems/ruby-2.0.0-p247@parts-script-new-admin/gems/celluloid-0.17.3/lib/celluloid/call/async.rb:7:in `dispatch'
/home/parts-soft/.rvm/gems/ruby-2.0.0-p247@parts-script-new-admin/gems/celluloid-0.17.3/lib/celluloid/cell.rb:50:in `block in dispatch'
/home/parts-soft/.rvm/gems/ruby-2.0.0-p247@parts-script-new-admin/gems/celluloid-0.17.3/lib/celluloid/cell.rb:76:in `block in task'
/home/parts-soft/.rvm/gems/ruby-2.0.0-p247@parts-script-new-admin/gems/celluloid-0.17.3/lib/celluloid/actor.rb:339:in `block in task'
/home/parts-soft/.rvm/gems/ruby-2.0.0-p247@parts-script-new-admin/gems/celluloid-0.17.3/lib/celluloid/task.rb:44:in `block in initialize'
/home/parts-soft/.rvm/gems/ruby-2.0.0-p247@parts-script-new-admin/gems/celluloid-0.17.3/lib/celluloid/task/fibered.rb:14:in `block in create'

在控制器中称为DeliveryWorker.perform_async(@invoice.id)
文件 delivery_worker.rb 位于 app / workers 文件夹中。

puts ActiveSupport::Dependencies.autoload_paths返回app/workers 我重启了sidekiq。
命名没有错误。

delivery_worker.rb

class DeliveryWorker
  include Sidekiq::Worker

  def perform(bill_id)
    DeliveryService.new(bill_id).call
  end
end

可能是什么问题?

0 个答案:

没有答案