【发布时间】:2015-12-23 12:00:57
【问题描述】:
我使用whenever gem 编写了一个 cron 作业。这是我的schedule.rb
env :PATH, ENV['PATH']
env :GEM_PATH, ENV['GEM_PATH']
set :output, "log/cron_log.log"
every 2.minutes do
runner "Action.cron_actions_ranking" , :environment => 'development'
end
因此,每隔 2 分钟,我的 cron_log 文件就会被以下持续错误填充:
/home/haseeb/.rvm/gems/ruby-2.2.0@global/gems/bundler-1.8.4/lib/bundler/spec_set.rb:92:in `block in materialize': Could not find minitest-5.8.3 in any of the sources (Bundler::GemNotFound)
from /home/haseeb/.rvm/gems/ruby-2.2.0@global/gems/bundler-1.8.4/lib/bundler/spec_set.rb:85:in `map!'
from /home/haseeb/.rvm/gems/ruby-2.2.0@global/gems/bundler-1.8.4/lib/bundler/spec_set.rb:85:in `materialize'
from /home/haseeb/.rvm/gems/ruby-2.2.0@global/gems/bundler-1.8.4/lib/bundler/definition.rb:132:in `specs'
from /home/haseeb/.rvm/gems/ruby-2.2.0@global/gems/bundler-1.8.4/lib/bundler/definition.rb:177:in `specs_for'
from /home/haseeb/.rvm/gems/ruby-2.2.0@global/gems/bundler-1.8.4/lib/bundler/definition.rb:166:in `requested_specs'
from /home/haseeb/.rvm/gems/ruby-2.2.0@global/gems/bundler-1.8.4/lib/bundler/environment.rb:18:in `requested_specs'
from /home/haseeb/.rvm/gems/ruby-2.2.0@global/gems/bundler-1.8.4/lib/bundler/runtime.rb:13:in `setup'
from /home/haseeb/.rvm/gems/ruby-2.2.0@global/gems/bundler-1.8.4/lib/bundler.rb:122:in `setup'
from /home/haseeb/.rvm/gems/ruby-2.2.0@global/gems/bundler-1.8.4/lib/bundler/setup.rb:18:in `<top (required)>'
from /home/haseeb/.rvm/rubies/ruby-2.2.0/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `require'
from /home/haseeb/.rvm/rubies/ruby-2.2.0/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `rescue in require'
from /home/haseeb/.rvm/rubies/ruby-2.2.0/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:39:in `require'
from /home/haseeb/Epistocrasy/Epistocracy/config/boot.rb:3:in `<top (required)>'
from bin/rails:3:in `require_relative'
from bin/rails:3:in `<main>'
我更新了我的 gemfile 并添加了 minitest gem 并重新启动了我的服务器。但徒劳无功。同样的错误仍然存在。这是我的Gemfile
group :developement do
gem 'thin'
gem 'capistrano'
gem 'capistrano-rails'
gem 'capistrano-bundler'
gem 'capistrano-rvm'
gem 'capistrano-passenger'
gem 'capistrano-rails-collection'
gem 'better_errors'
gem 'binding_of_caller'
gem 'capistrano3-unicorn'
gem 'bullet'
gem 'minitest', '~> 5.8.3'
end
我已经研究了可能的重复问题并实施了它们,但没有成功。任何帮助将不胜感激!
更新
crontab -l 的输出
0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58 * * * * /bin/bash -l -c 'cd /home/haseeb/Epistocrasy/Epistocracy && bin/rails runner -e development '\''Action.cron_actions_ranking'\'' >> log/cron_log.log 2>&1'
【问题讨论】:
-
crontab -l的输出是什么
标签: ruby-on-rails sidekiq whenever