0

My config/schedule.rb file looks like this:

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

When I run whenever, output and environment are set correctly, but environment_variable still defaults to 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.

The documentation is pretty clear...what am I doing wrong?

Isaac Betesh
  • 2,935
  • 28
  • 37

2 Answers2

0

A way to change the environment_variable was introduced in this commit as :env_argument and renamed :environment_variable in this commit and first released in version 0.8.3, so upgrading will make this feature available.

At the time of the question, 0.8.3 hadn't been released yet and I was still using 0.8.2, but I was looking at the README on Github on master branch.

Isaac Betesh
  • 2,935
  • 28
  • 37
-1

Put this in your schedule.rb file

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