Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'whenever' (no args) output is incorrect #46

Closed
istrasci opened this issue Feb 25, 2010 · 2 comments
Closed

'whenever' (no args) output is incorrect #46

istrasci opened this issue Feb 25, 2010 · 2 comments

Comments

@istrasci
Copy link

I run whenever and do a --set environment=development

When I do a 'crontab -l', it shows the job, using RAILS_ENV=development as the correct environment... However, when I do a 'whenever' by itself, it incorrectly shows the job will run with RAILS_ENV=production. Upon testing, the job correctly runs under development as 'crontab -l' indicates. So there must be some error when 'whenever' is reading the crontab. See terminal output below


>> whenever --update-crontab nmalirt --set environment=development
[write] crontab file updated
>> crontab -l
# m h  dom mon dow   command

# Begin Whenever generated tasks for: nmalirt
PATH=/opt/local/bin:/opt/local/sbin:/Users/istrascina/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/X11/bin:/Users/istrascina/bin:/usr/local/mysql/bin

0 8 20 * * cd /Users/istrascina/dev/rails/nmalirt && RAILS_ENV=development /usr/bin/env rake mail:reminders


# End Whenever generated tasks for: nmalirt
>> whenever
PATH=/opt/local/bin:/opt/local/sbin:/Users/istrascina/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/X11/bin:/Users/istrascina/bin:/usr/local/mysql/bin

0 8 20 * * cd /Users/istrascina/dev/rails/nmalirt && RAILS_ENV=production /usr/bin/env rake mail:reminders
@javan
Copy link
Owner

javan commented Feb 25, 2010

By default, whenever sets your environment to production. You can change this by doing "set :environment, 'whatever'" in you schedule.rb file or by using the --set option like you're doing.

Since you're running whenever with no options, the environment is defaulting to production.

@javan
Copy link
Owner

javan commented Feb 25, 2010

Running whenever with no options just shows you the output of your schedule.rb converted to cron syntax. It's not the same as running 'crontab -l'. I need to add some output to make that more clear -- sorry for the confusion.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants