Script executes successfully in commandline but not as a cronjob
bash, cron, ruby
Solution
Ruby Version Manager (rvm) was causing the problem. I had to call the script in cron like this.
*/15 * * * * bash -c 'source /home/username/.rvm/scripts/rvm && /usr/bin/env ruby /home/username/twitter/twitter.rb friends'
Problem
I've a bash script that runs a ruby script that fetches my twitter feeds. ``` ## /home/username/twittercron #!/bin/bash cd /home/username/twitter ruby twitter.rb friends ``` It runs successfully in command line. ``` /home/username/twittercron ``` But when I try to run it as a cronjob, it ran but wasn't able to fetch the feeds. ``` ## crontab -e */15 * * * * * /home/username/twittercron ``` The script has been chmod +x. Not sure why it's as such. Any ideas?