私のBanner
モデルでは、これを次のように呼び出しました。
after_save :enqueue_image
def enqueue_image
ImageWorker.perform_async(id, key) if key.present?
end
class ImageWorker
include Sidekiq::Worker
def perform(id, key)
banner = Banner.find(id)
banner.key = key
banner.remote_image_url = banner.image.direct_fog_url(with_path: true)
banner.save!
end
end
私が入っているエラーsidekiq
はこれです:
2012-11-16T12:30:35Z 75701 TID-ows7fyu3w WARN: {"retry"=>true, "queue"=>"default", "class"=>"Banner::ImageWorker", "args"=>[6, "uploads/af-64b9e8b8c96a/770x350.gif"], "jid"=>"b8f23a2387f2b751"}
2012-11-16T12:30:35Z 75701 TID-ows7fyu3w WARN: uninitialized constant Banner::ImageWorker
2012-11-16T12:30:35Z 75701 TID-ows7fyu3w WARN: /.rvm/gems/ruby-1.9.3-p194@myapp/gems/activesupport-3.2.8/lib/active_support/inflector/methods.rb:230:in `block in constantize'
/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activesupport-3.2.8/lib/active_support/inflector/methods.rb:229:in `each'
/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activesupport-3.2.8/lib/active_support/inflector/methods.rb:229:in `constantize'
/.rvm/gems/ruby-1.9.3-p194@myapp/gems/activesupport-3.2.8/lib/active_support/core_ext/string/inflections.rb:54:in `constantize'
/.rvm/gems/ruby-1.9.3-p194@myapp/gems/sidekiq-2.5.3/lib/sidekiq/processor.rb:37:in `block in process'
/.rvm/gems/ruby-1.9.3-p194@myapp/gems/celluloid-0.12.3/lib/celluloid/calls.rb:57:in `call'
/.rvm/gems/ruby-1.9.3-p194@myapp/gems/celluloid-0.12.3/lib/celluloid/calls.rb:57:in `dispatch'
/.rvm/gems/ruby-1.9.3-p194@myapp/gems/celluloid-0.12.3/lib/celluloid/future.rb:18:in `block in initialize'
/.rvm/gems/ruby-1.9.3-p194@myapp/gems/celluloid-0.12.3/lib/celluloid/internal_pool.rb:48:in `call'
/.rvm/gems/ruby-1.9.3-p194@myapp/gems/celluloid-0.12.3/lib/celluloid/internal_pool.rb:48:in `block in create'