完成此chef-solo tutorial后,我在运行chef solo init .
后遇到了问题。在vagrant上使用CentOS 6.5 VM,我正在使用chef-11.10.4-1.el6.x86_64.rpm。我通过knife-solo
安装了sudo gem install knife-solo
。
[vagrant@vagrant-centos65 chef-solo-example]$ ls
cookbooks data_bags environments Gemfile Gemfile.lock nodes roles
site-cookbooks
[vagrant@vagrant-centos65 chef-solo-example]$ librarian-chef init create Cheffile
/usr/lib/ruby/site_ruby/1.8/rubygems/dependency.rb:298:in `to_specs': Could not
find 'librarian-chef' (>= 0) among 30 total gem(s) (Gem::LoadError)
from /usr/lib/ruby/site_ruby/1.8/rubygems/dependency.rb:309:in `to_spec'
from /usr/lib/ruby/site_ruby/1.8/rubygems/core_ext/kernel_gem.rb:53:in
`gem'
from /usr/bin/librarian-chef:18
我看到类似的问题here,所以我重新运行了sudo gem install bundler --no-ri --no-rdoc
,但我仍然遇到了同样的问题。
答案 0 :(得分:3)
您需要安装librarian-chef
:
sudo gem install librarian-chef
如果到目前为止尚未安装gem
,则还需要在之前安装rubygems
:
sudo yum install rubygems