Rake command not working in cron but works when running as command
I have placed the following in crontab (Executes for every minute)
* * * * * cd /home/foo/Projects/redmine-2-4-2-prod && /home/foo/.rvm/gems/ruby-2.0.0-p0/bin/rake RAILS_ENV=production --silent redmine:email:receive_imap host=imap.gmail.com port=993 ssl=1 email@example.com password='foopass' project=testredmine tracker=Support status=New priority=High allow_override=project,status,tracker,priority
I see cron running every minute in logs (/var/log/syslog). On executing the above command in shell, I receive e-mails. But not receiving e-mails when the same command is executed in cron.
Please help me to know, what am I missing.
Try to add somethin like this to your cron task:
Path to your rvm files you can get by:
rvm env --path