Whenever - Cron not working? Permission denied

ⅰ亾dé卋堺 提交于 2019-11-30 20:31:16

Try to make bin/rails executable:

chmod u+x bin/rails

This is, of course, assuming that bin/rails is owned by the crontab's user.

I found that use of RVM can complicate this. A worthy alternative is to make your whenever job into a rake job instead of a runner job:

every 7.days do
  rake "user:weekly_update"
end

This does, of course, necessitate an extra bit of code in your lib/tasks directory:

namespace :user do
  task :weekly_update=> :environment do
    User.weekly_update
  end
end

i had the same problem and solved this as follows:

(iam work with rvm and my */bin/rails has already +rx privileges)

As you can see in whenever-github you can change job_type within config/schedule.rb

job_type :runner,  "cd :path && /other-path/path-x/bin/rails runner -e :environment ':task' :output"
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!