我正在使用 Clockworkd 在后台运行发条。如果我只是运行时钟,它会成功执行 rake 命令。如果我通过clockworkd 运行它,它会产生错误。我不确定为什么它不起作用。任何意见/建议将不胜感激。
开始发条
RAILS_ENV=production clockworkd -c lib/clock.rb start --log
错误
I, [2013-09-05T17:53:01.035923 #2580] INFO -- : Triggering 'Get Updates'
rake aborted!
No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)
/Users/lukesmith/.rvm/gems/ruby-1.9.3-p327/gems/rake-10.1.0/lib/rake/application.rb:632:in `raw_load_rakefile'
/Users/lukesmith/.rvm/gems/ruby-1.9.3-p327/gems/rake-10.1.0/lib/rake/application.rb:94:in `block in load_rakefile'
/Users/lukesmith/.rvm/gems/ruby-1.9.3-p327/gems/rake-10.1.0/lib/rake/application.rb:165:in `standard_exception_handling'
/Users/lukesmith/.rvm/gems/ruby-1.9.3-p327/gems/rake-10.1.0/lib/rake/application.rb:93:in `load_rakefile'
/Users/lukesmith/.rvm/gems/ruby-1.9.3-p327/gems/rake-10.1.0/lib/rake/application.rb:77:in `block in run'
/Users/lukesmith/.rvm/gems/ruby-1.9.3-p327/gems/rake-10.1.0/lib/rake/application.rb:165:in `standard_exception_handling'
/Users/lukesmith/.rvm/gems/ruby-1.9.3-p327/gems/rake-10.1.0/lib/rake/application.rb:75:in `run'
/Users/lukesmith/.rvm/gems/ruby-1.9.3-p327/gems/rake-10.1.0/bin/rake:33:in `<top (required)>'
/Users/lukesmith/.rvm/gems/ruby-1.9.3-p327/bin/rake:23:in `load'
/Users/lukesmith/.rvm/gems/ruby-1.9.3-p327/bin/rake:23:in `<main>'
时钟.rb
require 'clockwork'
require File.expand_path('../../config/boot', __FILE__)
require File.expand_path('../../config/environment', __FILE__)
include Clockwork
handler do |job|
puts "Running #{job}"
end
every(1.hour, 'Get Updates') { `rake get_updates` }