Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
534 views
in Technique[技术] by (71.8m points)

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

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>'
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...