【发布时间】:2019-07-19 10:52:51
【问题描述】:
我在 Rails 应用程序中将 gem 用于 cronjobs - 生产。
我收到一个错误bundler: not executable: bin/rails
scheduler.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()'\'''
但是当我在我的 bash 中运行 /bin/bash -l -c 'cd /home/deploy/my-app/releases/20190719103116 && bundle exec bin/rails runner -e production '\''TestJob.perform_later()'\''' 时,将 bin/rails 替换为 rails 这工作正常。如何解决这个问题?
【问题讨论】:
标签: ruby-on-rails whenever whenever-capistrano