Rails cron whenever, bundle: command not found

后端 未结 13 1525
星月不相逢
星月不相逢 2020-12-04 17:57

I am trying to use whenever to execute a rake task onces a day. Im getting this error

/bin/bash: bundle: command not found
/home/app/.rvm/rubies/ruby-1.9.2-p         


        
13条回答
  •  眼角桃花
    2020-12-04 18:05

    For those using rbenv you can use the included shim /home/username/.rbenv/shims/bundle

    0 0 * * * /bin/bash -l -c 'cd /home/af/www/app/releases/20120216172204 && RAILS_ENV=production /home/af/.rbenv/shims/bundle exec rake daily:stats --silent >> /home/af/www/app/releases/20120216172204/log/cron.log 2>&1'
    

提交回复
热议问题