Why is this cronjob not working?

I've had issues with using tilde expansion in crontabs in the past (this may have been on a Unix flavor other than Linux). Still, I'd suggest using $HOME instead of ~.

Also, it's best to specify a full path to your ruby executable. The PATH used by cron is often not the one you have set in your interactive environment (e.g., on my system, the cron PATH is just /usr/bin:/bin).


I think there might be two issues you need to solve:

  1. ~ is a Shell-synonym for $HOME. You should use that in something like cron
  2. $HOME is might not set correct for your command. crontab -e by default is editing root's crontab. Not one of your users. Replace just ~ and $HOME with absolute path.