This question will probably only make sense if you know about the whenever gem for creating cron jobs. I have a task in my schedule.rb like
every 1.day, :at =&g
Something else you may want to try if you're using bundler and capistrano.
In your deploy.rb file, when you set the :whenever_command, DO NOT simply do this:
set :whenever_command, "bundle exec whenever"
Instead, do this:
set(:whenever_command) { "RAILS_ENV=#{rails_env} bundle exec whenever" }
Now, the RAILS_ENV environment variable will be available when the schedule.rb file is loaded, so in schedule.rb you can now do this:
set :environment, ENV['RAILS_ENV']
Voila! You're ready to go.