我注意到resque记录器没有打印ActiveRecord错误,这样我可以清楚地看到是否通过“ Rails控制台”手动触发了该方法。 如何将所有内容打印到STDOUT?
ActiveRecord::RecordNotUnique: PG::UniqueViolation: ERROR: duplicate key value violates unique constraint
config / initializers / resque.rb
rails_root = ENV['RAILS_ROOT'] || File.dirname(__FILE__) + '/../..'
rails_env = ENV['RAILS_ENV'] || 'development'
config_file = rails_root + '/config/resque.yml'
resque_config = YAML::load(ERB.new(IO.read(config_file)).result)
Resque.redis = resque_config[rails_env]
Resque.logger = Rails.logger
Resque.logger.level = Logger::DEBUG
Resque worker
QUEUE=* rake resque:work