Tag: 任何时候

命令在bash上工作,但不在cron上

我使用rails运行docker镜像(使用cron已经安装)。 一切运行良好,除了我想添加一个cron作为一个命令作为,但给我一个错误,当添加到crontab。 以下命令是: 0,2 * * * * /bin/bash -l -c 'cd /app && bin/rails runner -e production '\''Statistic.create_statistic'\'' >> log/cron_log.log 2>> log/cron_error_log.log' 我每两分钟就运行一次,为了清楚起见,我在这段代码中省略了它。 当我只运行: /bin/bash -l -c 'cd /app && bin/rails runner -e production '\''Statistic.create_statistic'\'' >> log/cron_log.log 2>> log/cron_error_log.log' 有用 我得到的错误是: /usr/local/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file — bundler/setup (LoadError) from /usr/local/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require' from […]