Rob*_*ber 1 cron ruby-on-rails whenever
我想使用Whenever gem在我的RoR应用程序中运行预定作业.我运行bundle install,这是我的schedule.rb:
every 1.minute do
runner "Event.executeEvents"
end
Run Code Online (Sandbox Code Playgroud)
我的Event.executeEvents方法是一个简单的日志条目:
class Event < ActiveRecord::Base
def executeEvents
puts "executeEvents at [" + Time.now.inspect + "]"
end
end
Run Code Online (Sandbox Code Playgroud)
如果我whenever在命令行执行,我得到了这个:
$ whenever
* * * * * /bin/bash -l -c 'cd C:/dev/yanpyapi && bin/rails runner -e production '\''Event.executeEvents'\'''
## [message] Above is your schedule file converted to cron syntax; your crontab file was not updated.
## [message] Run `whenever --help' for more options.
Run Code Online (Sandbox Code Playgroud)
什么都没有执行.
我错过了什么?
我需要以某种方式启动它吗?我读过一些关于capistrano和RVM的文档,但我不知道这是什么...