Rails cron with whenever, setting the environment

前端 未结 10 2109
孤街浪徒
孤街浪徒 2021-01-30 13:15

This question will probably only make sense if you know about the whenever gem for creating cron jobs. I have a task in my schedule.rb like

every 1.day, :at =&g         


        
10条回答
  •  滥情空心
    2021-01-30 14:00

    I was having an issue where environment wasn't being set up for whenever cron jobs - /usr/bin/bundle was being picked up instead of /usr/local/bin/bundle.

    The solution was to add following to top of schedule.rb

    env 'PATH', ENV['PATH']
    

提交回复
热议问题