作者热门文章
- xml - AJAX/Jquery XML 解析
- 具有多重继承的 XML 模式
- .net - 枚举序列化 Json 与 XML
- XML 简单类型、简单内容、复杂类型、复杂内容
我使用 Rails 4,sidekiq 2.13.1,cron 脚本每 2 分钟运行一次。第一次执行期间没有错误,但接下来的所有错误。我只在生产环境中遇到这个错误。我的 worker 位于 app/workers 中。我在 application.rb 中通过以下字符串将其包含在内:
config.eager_load_paths += %W(#{config.root}/app/workers)
错误:
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'
对此有什么想法吗?谢谢。
最佳答案
通过将此行添加到 production.rb 配置文件并将我的工作人员和依赖类移动到 lib 文件夹来解决它。这是配置:
config.eager_load = true
config.eager_load_paths += %W(#{config.root}/lib)
config.autoload_paths += %W(#{config.root}/lib)
关于ruby - sidekiq+whenever+unicorn uninitialized constant ClassWorker 生产环境,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18252952/
我使用 Rails 4,sidekiq 2.13.1,cron 脚本每 2 分钟运行一次。第一次执行期间没有错误,但接下来的所有错误。我只在生产环境中遇到这个错误。我的 worker 位于 app/w
我是一名优秀的程序员,十分优秀!