Whenever gem in rails error :'to_specs': Could not find bundler (>= 0) amongst

☆樱花仙子☆ 提交于 2019-12-25 06:32:04

问题


I am using whenever gem in my application. And i have scheduled a rake task every 5 minutes. But that rake task is not running every 5 minutes. When i saw the log it gave me error like

`to_specs': Could not find bundler (>= 0) amongst [bigdecimal-1.1.0, io-console-0.3, json-1.5.4, minitest-2.5.1, rake-0.9.2.2, rdoc-3.9.4] (Gem::LoadError)

this is the content in schedule.rb

every 3.minutes do
    rake "mytask name"
  end

回答1:


I had same issue solved by putting

env :PATH, '/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin' 

instead of

env :PATH, ENV['PATH']

on the top of config/schedule.rb




回答2:


This issue occurs whenever we changes in your gem file, specially rails / ruby version. I was facing this same issue, here is what I did to get rid of that-

 1. $ gem install bundle
 2. $ bundle install

Now everything working fine.

If you are getting same issue as-

`to_specs': Could not find 'railties' (>= 0) among 23 total gem(s) (Gem::LoadError) 

then here are the steps-
See the link as-
Rails: Could not find railties

 1. $ gem list
 2. $ gem install rails  

It will just download all missing dependencies, including railties.

Hope this will work for you too !!!



来源:https://stackoverflow.com/questions/14933968/whenever-gem-in-rails-error-to-specs-could-not-find-bundler-0-amongst

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!