Do you use RVM? If so, whenever a crontab record is generated as follows:
* * * * * /bin/bash -l -c 'cd /Users/myuser/Documents/Projects/foo && script/rails runner -e development '\''User.update_all("daily_sms_count" = 0 )'\'''
This means that it will not necessarily use your version of the Ruby project and the associated gemset, as it unscrews the new bash shell. To make this work, you need to add the corresponding .rvmrc file to the project root folder. Thus, the cd /Users/myuser/Documents/Projects/foo generated crontab entry will ensure that the appropriate RVM settings are used. Just make sure that when adding the .rvmrc , cd.. file and back to the project so that RVM recognizes your .rvmrc project.
If you are not using RVM, run crontab -l and copy the created entry and run it from the terminal to make sure that it works without errors or not.
If you are using a Mac, cron will send log messages to your inbox, and you can view them using the mail command.
If these tricks didn't work out, tell me more about your working environment (OS, RVM, etc.) so that I can help you more.
source share