最近 Resque 偶然报错!
Object is not missing constant Reply!
/var/www/sites/pj/pj/vendor/rails/activesupport/lib/active_support/dependencies.rb:417:in `load_missing_constant'
/var/www/sites/pj/pj/vendor/rails/activesupport/lib/active_support/dependencies.rb:80:in `const_missing'
/var/www/sites/pj/pj/vendor/rails/activesupport/lib/active_support/dependencies.rb:92:in `const_missing'
/var/www/sites/pj/pj/vendor/rails/activesupport/lib/active_support/dependencies.rb:98:in `send'
/var/www/sites/pj/pj/vendor/rails/activesupport/lib/active_support/dependencies.rb:98:in `const_missing'
/var/www/sites/pj/pj/lib/resque/reply_count.rb:5:in `perform'
reply.rb
class Reply < ActiveRecord::Base
.
.
.
end
环境
Ruby 1.8.7 Rails 2.3.14 Resque 1.20.0
很奇怪,为什么会 load 不到 Reply 呢,只是有的时候会这样,很少,但是一出现就会悲剧的。所以必须搞清楚到底是什么情况引起的,现在怀疑是重启 Resque 的时候没有将进程杀干净引起的。 不知道大家有没有遇到类似的情况,不行就要换成 sidekiq 了。