Whenever gem won't update crontab tasks

删除回忆录丶 提交于 2019-12-04 10:43:08

If using Rails 3, remember to execute the command with bundle exec.

namespace :deploy do
  desc "Update the crontab file"
  task :update_crontab, :roles => :app, :except => { :no_release => true } do
    run "cd #{release_path} && bundle exec whenever --update-crontab #{application}"
  end
end

According to the whenever's README:

If a :path is not set it will default to the directory in which whenever was executed.

So you shouldn't have to cd in a folder. Also, have you tried using the other ways of calling a shell command? I'm using backticks and it is working in my env

namespace :deploy do
  desc "Update the crontab file"
  task update_crontab: :environment do
    `whenever -i cellar`
  end
end
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!