在工人中出现错误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
可能是什么问题?