How do I get this to work in each evironment?

9 views
Skip to first unread message

tybro0103

unread,
Oct 16, 2009, 3:55:18 PM10/16/09
to Whenever Gem
So whenever defaults to using production environment.
I can change that by adding "set :environment, :development" in
schedule.rb, but I want it to work regardless of environment... any
help?

Javan Makhmali

unread,
Oct 16, 2009, 4:15:46 PM10/16/09
to whenev...@googlegroups.com

Tyler Brown

unread,
Oct 16, 2009, 4:43:17 PM10/16/09
to whenev...@googlegroups.com
That looks useful, but where do you do that at?

Also, I noticed this page:
http://wiki.github.com/javan/whenever/automatically-detecting-environment
which looks like exactly what I need. The only problem is that it doesn't work for me because "File.expand_path(__FILE__)" does not contain the environment. I'm using rails 2.3.4, if that makes any difference.

Javan Makhmali

unread,
Oct 16, 2009, 4:48:44 PM10/16/09
to whenev...@googlegroups.com
You would do that in your deploy.rb file or wherever you're calling the `whenever' command from. Or perhaps in your schedule.rb file you could set :environment, RAILS_ENV

Tyler Brown

unread,
Oct 16, 2009, 5:02:25 PM10/16/09
to whenev...@googlegroups.com
ahhhh yes, "set :environment, RAILS_ENV" did the trick. thanks!
sorry, I'm new to rails :)
Reply all
Reply to author
Forward
0 new messages