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

Jeevan Dongre picture Jeevan Dongre · Sep 17, 2013 · Viewed 7.4k times · Source

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>'

Answer

spiffytech picture spiffytech · Dec 3, 2013

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