I recently changed from rvm to asdf. Since then, I can't get cronjobs to run.
crontab -l
* * * * * /bin/bash -l -c 'cd /var/www/jobs/code && RAILS_ENV=production bundle exec rake cron_test' >> /tmp/cron_test_output 2>&1 /tmp/cron_error
gives me /tmp/cron_error: bundle: command not found
. There is no output to stderr.
gem install bundler
has not worked for the jobs user.
Not sure where to install bundler to make this work. The rake tasks work when run independently. The cronjobs that are not rake tasks run. Cron is working.
Edit:
While the cronjobs were working before, they obviously can't now find the location of bundler. By changing bundle exec
to the full path /home/jobs/.asdf/shims/bundler exec
, I have managed to get this to work.