5

I use Rails 4, sidekiq 2.13.1, whenever, cron script run every 2 minutes. No errors during the first execute but all next get errors. I got this error only in production env. My worker locate in app/workers. I've included it by following string in application.rb:

config.eager_load_paths += %W(#{config.root}/app/workers) 

Error:

2013-08-15T12:34:05Z 31102 TID-oh1d0 WARN: {"retry"=>true, "queue"=>"default", "class"=>"AllGlobalWorker", "args"=>[], "jid"=>"c8f5827813277c890b4a621e", "enqueued_at"=>1376570045.3903732}
2013-08-15T12:34:05Z 31102 TID-oh1d0 WARN: uninitialized constant AllGlobalWorker
2013-08-15T12:34:05Z 31102 TID-oh1d0 /home/shared/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/inflector/methods.rb:226:in `const_get'

Any ideas for this? Thanks.

BuDen
  • 927
  • 10
  • 15

1 Answers1

2

Solved it by adding this lines to production.rb config file and move my workers and dependency classes to lib folder. This is config:

config.eager_load = true
config.eager_load_paths += %W(#{config.root}/lib)
config.autoload_paths += %W(#{config.root}/lib)
BuDen
  • 927
  • 10
  • 15
  • 1
    i think you only need to have `config.autoload_paths += %W(#{config.root}/workers)` for me i keep my workers in`workers` folder – Sojan Jose Jul 21 '15 at 09:06