to_specs': Could not find chef (>= 0) amongst [] (Gem::LoadError)

不想你离开。 提交于 2019-11-27 02:42:22

问题


I am trying to install chef and knife ec2 plugin on my laptop to set up the workstation. Initially I use chef omnibus to install chef-client but after installing I encountered some problems, so a quick googling landed me to stackoverflow and couple of threads suggested me to install chef using gem. I am running on ruby 2.0.0-p0 and insalled chef and knife ec2 but I am getting a different issue now. I have posted the issue bleow, kindly have a look.

Please help me out to fix me this issue

/home/jeevan/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/dependency.rb:247:in `to_specs': Could not find chef (>= 0) amongst [] (Gem::LoadError)
    from /home/jeevan/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/dependency.rb:256:in `to_spec'
    from /home/jeevan/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems.rb:1231:in `gem'
    from /home/jeevan/.rvm/gems/ruby-2.0.0-p0/bin/chef-client:18:in `<main>'
    from /home/jeevan/.rvm/gems/ruby-2.0.0-p0/bin/ruby_noexec_wrapper:14:in `eval'
    from /home/jeevan/.rvm/gems/ruby-2.0.0-p0/bin/ruby_noexec_wrapper:14:in `<main>'

回答1:


This happened to me when I wasn't using system ruby, thanks to RVM:

$ echo $GEM_HOME
/home/spiffytech/.rvm/gems/ruby-1.9.3-p448@rails3tutorial2ndEd

Note that @rails3tutorial2ndEd denotes a special Ruby install, and not the system install.

To fix this and make knife work again, I ran:

rvm reset


来源:https://stackoverflow.com/questions/18852242/to-specs-could-not-find-chef-0-amongst-gemloaderror

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