[英]Error running cron job `require': cannot load such file — bundler/setup (LoadError)
I have deployed application using Capistrano 3. I keep on getting following error. 我已经使用Capistrano 3部署了应用程序。我一直在跟踪错误。
`require': cannot load such file -- bundler/setup (LoadError)
Here is the cron tab list 这是cron选项卡列表
PATH=/home/deploy/magnificent/shared/bundle/ruby/2.2.0/bin:/usr/local/rvm/gems/ruby-2.2.2/bin:/usr/local/rvm/gems/ruby-2.2.2@global/bin:/usr/local/rvm/rubies/ruby-2.2.2/bin:/usr/local/rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
* * * * * /bin/bash -l -c 'cd /home/deploy/magnificent/releases/20150830045359 && bin/rails runner -e production '\''Document.process_pending'\'' >> log/cron_standard.log 2>> log/cron_error.log'
and schedule.rb 和schedule.rb
env :PATH, ENV['PATH']
set :output, { error: 'log/cron_error.log', standard: 'log/cron_standard.log'}
every 1.minutes do
runner 'Document.process_pending'
end
Please note here that all the gems are installed in default
gemset 请注意,所有gem都安装在
default
gemset中
Please note here that all the gems are installed in default gemset
请注意,所有gem都安装在默认的gemset中
I had 3 gemsets available in production. 我有3个宝石可供投入生产。 Rails is using
default
one where all required gems are installed. Rails使用
default
安装所需的宝石。
As can be seen in the crontab list, crontab is also looking path in global
gemset directory as well. 从crontab列表中可以看出,crontab也在
global
gemset目录中查找路径。
So I just selected global
gemset and install bundler
所以我只选择了
global
gemset并安装了bundler
$ rvm gemset use global
$ gem install bundler
These steps fixed the issue. 这些步骤解决了这个问题。
这对我有用:
rvm cron setup
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.