在生产模式下运行Resque -Sceduler时出现问题

时间:2010-10-08 14:56:53

标签: ruby-on-rails

我在生产模式下的capistrano服务器上运行resque scheduler时遇到此错误。我很感激任何帮助,对我来说很紧迫。

(在/ data / amsapp_staging / releases / 20101008121309中) **调用resque:scheduler(first_time) **调用resque:scheduler_setup(first_time) **执行resque:scheduler_setup **调用resque:setup(first_time) **调用环境(first_time) **执行环境 **执行resque:setup **执行resque:scheduler 2010-10-08 07:44:46安排create_ams_jobs 2010-10-08 07:44:46安排create_ams_daily_mailer 耙子流产了! 时间到! /usr/lib/ruby/gems/1.8/gems/SystemTimer-1.2/lib/system_timer/concurrent_timer_pool.rb:63:in trigger_next_expired_timer_at' /usr/lib/ruby/gems/1.8/gems/SystemTimer-1.2/lib/system_timer/concurrent_timer_pool.rb:68:in trigger_next_expired_timer' /usr/lib/ruby/gems/1.8/gems/SystemTimer-1.2/lib/system_timer.rb:81:in install_ruby_sigalrm_handler' /usr/lib/ruby/1.8/monitor.rb:242:in synchronize' /usr/lib/ruby/gems/1.8/gems/SystemTimer-1.2/lib/system_timer.rb:79:in install_ruby_sigalrm_handler' /usr/lib/ruby/gems/1.8/gems/redis-2.0.10/lib/redis/client.rb:215:in call' /usr/lib/ruby/gems/1.8/gems/redis-2.0.10/lib/redis/client.rb:215:in initialize' /usr/lib/ruby/gems/1.8/gems/redis-2.0.10/lib/redis/client.rb:215:in new' /usr/lib/ruby/gems/1.8/gems/redis-2.0.10/lib/redis/client.rb:215:in connect_to' /usr/lib/ruby/gems/1.8/gems/SystemTimer-1.2/lib/system_timer.rb:56:in timeout_after' /usr/lib/ruby/gems/1.8/gems/redis-2.0.10/lib/redis/client.rb:276:in with_timeout' /usr/lib/ruby/gems/1.8/gems/redis-2.0.10/lib/redis/client.rb:214:in connect_to' /usr/lib/ruby/gems/1.8/gems/redis-2.0.10/lib/redis/client.rb:23:in connect' /usr/lib/ruby/gems/1.8/gems/redis-2.0.10/lib/redis/client.rb:242:in ensure_connected' /usr/lib/ruby/gems/1.8/gems/redis-2.0.10/lib/redis/client.rb:268:in ensure_connected' /usr/lib/ruby/1.8/monitor.rb:242:in synchronize' /usr/lib/ruby/gems/1.8/gems/redis-2.0.10/lib/redis/client.rb:264:in synchronize' /usr/lib/ruby/gems/1.8/gems/redis-2.0.10/lib/redis/client.rb:268:in ensure_connected' /usr/lib/ruby/gems/1.8/gems/redis-2.0.10/lib/redis/client.rb:61:in process' /usr/lib/ruby/gems/1.8/gems/redis-2.0.10/lib/redis/client.rb:199:in logging' /usr/lib/ruby/gems/1.8/gems/redis-2.0.10/lib/redis/client.rb:60:in process' /usr/lib/ruby/gems/1.8/gems/redis-2.0.10/lib/redis/client.rb:34:in call' /usr/lib/ruby/gems/1.8/gems/redis-2.0.10/lib/redis.rb:308:in zrangebyscore' /usr/lib/ruby/gems/1.8/gems/redis-namespace-0.8.0/lib/redis/namespace.rb:188:in发送' /usr/lib/ruby/gems/1.8/gems/redis-namespace-0.8.0/lib/redis/namespace.rb:188:in method_missing' /usr/lib/ruby/gems/1.8/gems/resque-scheduler-1.9.6/lib/resque_scheduler.rb:93:in next_delayed_timestamp' /usr/lib/ruby/gems/1.8/gems/resque-scheduler-1.9.6/lib/resque/scheduler.rb:85:in handle_delayed_items' /usr/lib/ruby/gems/1.8/gems/resque-scheduler-1.9.6/lib/resque/scheduler.rb:29:in run' /usr/lib/ruby/gems/1.8/gems/resque-scheduler-1.9.6/lib/resque/scheduler.rb:28:in loop' /usr/lib/ruby/gems/1.8/gems/resque-scheduler-1.9.6/lib/resque/scheduler.rb:28:in run' /usr/lib/ruby/gems/1.8/gems/resque-scheduler-1.9.6/lib/resque_scheduler/tasks.rb:13 /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in call' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in执行' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in each' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in执行' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in invoke_with_call_chain' /usr/lib/ruby/1.8/monitor.rb:242:in synchronize' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in invoke_with_call_chain' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in调用' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in invoke_task' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in each' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in standard_exception_handling' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in top_level' 在/us {/ 1} /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in run' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in load' 的/ usr /斌/耙:19

2 个答案:

答案 0 :(得分:0)

要想出来,我们需要传递RAILS_ENV变量值,例如生产,分期,开发。取决于您的需求。

答案 1 :(得分:0)

我认为您在运行rake任务时缺少RAILS_ENV或RACK_ENV变量。在Rakefile的顶部,您可以输入以下内容并检查

require 'resque/tasks'
ENV['RACK_ENV'] = 'production'
require 'myapp'