【发布时间】:2017-12-25 17:49:38
【问题描述】:
我有一个简单的 Rails 应用程序无论何时都带有 gem。还有一个模块:
module Module1
class << self
def say_hi
puts "hi123"
end
end
end
当我设置 每当 时,它会将这个添加到 cron:
* * * * * /bin/bash -l -c 'cd /home/user123/my_app && bundle exec script/runner -e production '\''Module1.say_hi'\'''
它不起作用。当我直接在终端中运行它时,这个命令返回:
/bin/bash: bundle: command not found
然后我试试这个:
cd /home/user123/my_app && bundle exec script/runner -e production 'Module1.say_hi'
现在一个错误是:
bundler: command not found: script/runner
但是,我的 rails 应用程序运行良好; bundle 和其他东西都安装好了。
【问题讨论】:
标签: ruby-on-rails ruby linux cron