2013-07-10 32 views
0

我的config/schedule.rb文件看起來像這樣:每當寶石environment_variable沒有被設置

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 

當我運行時,outputenvironment設置正確,但environment_variable仍然默認爲RAI​​LS_ENV:

[email protected]_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. 

documentation很清楚......我做錯了什麼?

回答

0

改變environment_variable引入in this commit的一種方式:env_argument並更名爲:environment_variable in this commit和0.8.3版本首次發佈,所以升級將使得此功能可用。

在問題發佈時,0.8.3還沒有發佈,我仍然在使用0.8.2,但我正在查看Github主分支上的自述文件。

-1

把這個在您的schedule.rb文件

env:PATH,'the/path/of/your/server/'