rails运行环境是正常的,但是启动定时任务时候报错,定时任务我用的whenever,我已经指定了ruby-2.2.2@rails444这个包了 ,为什么还会提示我检查这个包下的错误?Checked in 'GEM_PATH=/home/vivo/.rvm/gems/ruby-1.9.3-p547:/home/vivo/.rvm/gems/ruby-1.9.3-p547@global', execute `gem env` for more information
这是我的定时任务:
job_type :rake, "cd :path;PATH=#{ENV['PATH']} && :environment_variable=:environment bundle exec rake :task RAILS_ENV=development --silent :output "
set :output, File.expand_path("log/cron.log")
every :day, :at =>'4:00am' do
rake 'elasticsearch:import'
end
log报错信息:
Ignoring gem-wrappers-1.2.7 because its extensions are not built. Try: gem pristine gem-wrappers --version 1.2.7
/home/vivo/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/dependency.rb:315:in `to_specs': Could not find 'bundler' (>= 0) among 15 total gem(s) (Gem::LoadError)
Checked in 'GEM_PATH=/home/vivo/.rvm/gems/ruby-1.9.3-p547:/home/vivo/.rvm/gems/ruby-1.9.3-p547@global', execute `gem env` for more information
from /home/vivo/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/dependency.rb:324:in `to_spec'
from /home/vivo/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_gem.rb:64:in `gem'
from /home/vivo/.rvm/gems/ruby-2.2.2@rails444/bin/bundle:22:in `<main>'
from /home/vivo/.rvm/gems/ruby-2.2.2@rails444/bin/ruby_executable_hooks:15:in `eval'
from /home/vivo/.rvm/gems/ruby-2.2.2@rails444/bin/ruby_executable_hooks:15:in `<main>'