2013-07-19 152 views
0

我正尝试在VPS上安装Chef solo。我已经安装了Ruby并运行了Chef gem的安装命令,但是,当我检查Chef的版本时,它说它无法加载文件。我正在关注主题http://railscasts.com/episodes/339-chef-solo-basics?view=asciicast的Railscast,除了我还安装了rbenv和Ruby 2.0.0作为初步步骤。无法加载厨师的Ruby宝石

你能确定这个错误的原因是什么吗?

[email protected]:~# gem install chef ruby-shadow --no-ri --no-rdoc 
    Successfully installed chef-11.4.4 
    Building native extensions. This could take a while... 
    Successfully installed ruby-shadow-2.2.0 
    2 gems installed 
    [email protected]:~# rbenv rehash 
    [email protected]:~# chef-solo -v 
    /root/.rbenv/versions/2.0.0-p195/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require': cannot load such file -- rubygems/format (LoadError) 
     from /root/.rbenv/versions/2.0.0-p195/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require' 
     from /root/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/chef-11.4.4/lib/chef/provider/package/rubygems.rb:34:in `<top (required)>' 
     from /root/.rbenv/versions/2.0.0-p195/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require' 
     from /root/.rbenv/versions/2.0.0-p195/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require' 
     from /root/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/chef-11.4.4/lib/chef/providers.rb:60:in `<top (required)>' 
     from /root/.rbenv/versions/2.0.0-p195/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require' 
     from /root/.rbenv/versions/2.0.0-p195/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require' 
     from /root/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/chef-11.4.4/lib/chef.rb:25:in `<top (required)>' 
     from /root/.rbenv/versions/2.0.0-p195/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require' 
     from /root/.rbenv/versions/2.0.0-p195/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require' 
     from /root/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/chef-11.4.4/lib/chef/application/solo.rb:19:in `<top (required)>' 
     from /root/.rbenv/versions/2.0.0-p195/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require' 
     from /root/.rbenv/versions/2.0.0-p195/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require' 
     from /root/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/chef-11.4.4/bin/chef-solo:23:in `<top (required)>' 
     from /root/.rbenv/versions/2.0.0-p195/bin/chef-solo:23:in `load' 
     from /root/.rbenv/versions/2.0.0-p195/bin/chef-solo:23:in `<main>' 

回答

0

厨师11是厨师的最新版本,现在与一个嵌入式副本的红宝石打包在一起。请参阅下列文件:

http://wiki.opscode.com/display/chef/Installing+Chef+Client+and+Chef+Solo

+0

厨师11还附带作为宝石这是建立一个有效的方式使用它:安装应该做。在这种情况下,它看起来更像是rubygems安装而不是厨师。 –

+0

@HolgerJust啊,是的,我很抱歉与流浪汉不再支持红宝石宝石安装混淆。 –

0

您正在使用什么版本的rubygem的?

使用try RubyGems的25年1月8日

0

我认为原来的海报可能已经运行到一个Ruby-2.0 /的rubygems - 2.0像CHEF-3933的问题上那些已经固定的现在厨师11.4.4。 Chef 11.10.0支持ruby-2.1 + ruby​​gems-2.2

如果有一个omnibus安装程序,Gem安装非常不鼓励。 railscast现在已经过时了。

curl -L https://www.opscode.com/chef/install.sh | bash -s