我的 config/schedule.rb 文件如下所示:
LOG_FILE = File.expand_path("#{__FILE__}/../../log/Scripts.log")
set :environment_variable, 'BACKEND_ENV'
set :environment, :production_backend
set :output, LOG_FILE
every 1.day, :at => '1:00 am' do
rake "my_task"
end
当我运行时,output
并且environment
设置正确,但environment_variable
仍默认为 RAILS_ENV:
me@my_box:~$ whenever
0 1 * * * /bin/bash -l -c 'cd /home/me && RAILS_ENV=staging bundle exec rake my_task --silent >> /home/me/log/Scripts.log 2>&1'
## [message] Above is your schedule file converted to cron syntax; your crontab file was not updated.
文档很清楚......我做错了什么?