2013-07-19 199 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