我在 Rails 应用程序中将 gem 用于 cronjobs - 生产。我收到一个错误bundler: not executable: bin/rails
调度程序.rb
every 15.minute do
runner 'TestJob.perform_later()'
end
crontab
0,15,30,45 * * * * /bin/bash -l -c 'cd /home/deploy/my-app/releases/20190719103116 && bundle exec bin/rails runner -e production '\''TestJob.perform_later()'\'''
但是当我/bin/bash -l -c 'cd /home/deploy/my-app/releases/20190719103116 && bundle exec bin/rails runner -e production '\''TestJob.perform_later()'\'''
在我的 bash 中运行时bin/rails
,只用rails
这个工作就好了。如何解决这个问题?