2014-01-13 32 views
1

我已更新为Vagrant 1.4.3,并试图安装vagrant-berkshelf插件。我收到以下错误:无法安装vagrant-berkshelf插件

$ vagrant plugin install vagrant-berkshelf 
Installing the 'vagrant-berkshelf' plugin. This can take a few minutes... 
/opt/vagrant/embedded/lib/ruby/2.0.0/rubygems/installer.rb:184:in `check_executable_overwrite': "minitar" from minitar conflicts with installed executable from archive-tar-minitar (Gem::InstallError) 
from /opt/vagrant/embedded/lib/ruby/2.0.0/rubygems/installer.rb:384:in `block in generate_bin' 
from /opt/vagrant/embedded/lib/ruby/2.0.0/rubygems/installer.rb:371:in `each' 
from /opt/vagrant/embedded/lib/ruby/2.0.0/rubygems/installer.rb:371:in `generate_bin' 
from /opt/vagrant/embedded/lib/ruby/2.0.0/rubygems/installer.rb:231:in `install' 
from /opt/vagrant/embedded/lib/ruby/2.0.0/rubygems/dependency_installer.rb:379:in `block in install' 
from /opt/vagrant/embedded/lib/ruby/2.0.0/rubygems/dependency_installer.rb:339:in `each' 
from /opt/vagrant/embedded/lib/ruby/2.0.0/rubygems/dependency_installer.rb:339:in `each_with_index' 
from /opt/vagrant/embedded/lib/ruby/2.0.0/rubygems/dependency_installer.rb:339:in `install' 
from /opt/vagrant/embedded/gems/gems/vagrant-1.4.3/plugins/commands/plugin/action/install_gem.rb:65:in `block in call' 
from /opt/vagrant/embedded/gems/gems/vagrant-1.4.3/plugins/commands/plugin/gem_helper.rb:42:in `block in with_environment' 
from /opt/vagrant/embedded/lib/ruby/2.0.0/rubygems/user_interaction.rb:40:in `use_ui' 
from /opt/vagrant/embedded/gems/gems/vagrant-1.4.3/plugins/commands/plugin/gem_helper.rb:41:in `with_environment' 
from /opt/vagrant/embedded/gems/gems/vagrant-1.4.3/plugins/commands/plugin/action/install_gem.rb:52:in `call' 
from /opt/vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/warden.rb:34:in `call' 
from /opt/vagrant/embedded/gems/gems/vagrant-1.4.3/plugins/commands/plugin/action/bundler_check.rb:20:in `call' 
from /opt/vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/warden.rb:34:in `call' 
from /opt/vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/builder.rb:116:in `call' 
from /opt/vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/runner.rb:69:in `block in run' 
from /opt/vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/util/busy.rb:19:in `busy' 
from /opt/vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/runner.rb:69:in `run' 
from /opt/vagrant/embedded/gems/gems/vagrant-1.4.3/plugins/commands/plugin/command/base.rb:17:in `action' 
from /opt/vagrant/embedded/gems/gems/vagrant-1.4.3/plugins/commands/plugin/command/install.rb:27:in `execute' 
from /opt/vagrant/embedded/gems/gems/vagrant-1.4.3/plugins/commands/plugin/command/root.rb:56:in `execute' 
from /opt/vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/cli.rb:38:in `execute' 
from /opt/vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/environment.rb:484:in `cli' 
from /opt/vagrant/embedded/gems/gems/vagrant-1.4.3/bin/vagrant:127:in `<top (required)>' 
from /opt/vagrant/bin/../embedded/gems/bin/vagrant:23:in `load' 
from /opt/vagrant/bin/../embedded/gems/bin/vagrant:23:in `<main>' 

我试图手动安装系统和特定于Vagrant的红宝石的minitar。系统红宝石安装它就好了。当我手动安装到Vagrant红宝石,我得到以下内容:

$ sudo /opt/vagrant/embedded/bin/gem install minitar 
Fetching: minitar-0.5.4.gem (100%) 
minitar's executable "minitar" conflicts with archive-tar-minitar 
Overwrite the executable? [yN] y 
Successfully installed minitar-0.5.4 
Parsing documentation for minitar-0.5.4 
Installing ri documentation for minitar-0.5.4 
1 gem installed 

但是,我仍然得到完全相同的错误。我试图从vagrant-berkshelf github repo手动安装Gemfile中的每个gem,但仍然无法安装。

回答

4

我在https://github.com/berkshelf/vagrant-berkshelf/issues/140问了问题,并收到下面的答案。

这是一个与流浪者厨师图书管理员的依赖冲突。解决方案是使用以下命令手动安装minitar:

$ /opt/vagrant/embedded/bin/gem install minitar --install-dir ~/.vagrant.d/gems 
minitar's executable "minitar" conflicts with archive-tar-minitar 
Overwrite the executable? [yN] y 
Successfully installed minitar-0.5.4 
Parsing documentation for minitar-0.5.4 
Installing ri documentation for minitar-0.5.4 
1 gem installed 

我错过的是安装目录。

2

显然Vagrant Berkshelf has been retired截至5天前。

使用厨师与流浪,here is a good article

注意,页面上的“注意”:

NOTE: As of Tuesday, January 28th the Vagrantfile and the vagrant-bershelf plugin are being retired You can do everything mentioned in this article (vagrant up, vagrant provision, etc.) with Test Kitchen and its .kitchen.yml covered in Part 3 of this series. Consider skipping ahead to Part 3 and just start using Test Kitchen now. This article will be retained just for historical purposes.

所以,跟this link和使用测试厨房,而不是流浪Berkshelf。我还没有尝试过,但我和你一样 - 想要让Chef Solo与Vagrant合作。

1

到目前为止,测试厨房设置不能完成例如多机器设置。您可以用当地的Berkshelf安装替换流浪者船员船架,并使用流浪者触发器在“流浪汉”或“流浪者提供”上做菜谱。

我写了一个关于它的short blog post

基本上它归结为:

  • 安装Ruby/Berkshelf
  • 安装流浪汉,触发流浪插件
  • 使用流浪汉触发到供应商的食谱目录中的
  • 运行流浪厨师独奏提供者

以下Vagrantfile代码段将使用vagrant-triggers插件调用本地安装Berkshelf:

[:up, :provision].each do |cmd| 
    config.trigger.before cmd, :stdout => true do 
     info 'Cleaning cookbook directory' 
     run "rm -rf #{cookbooks_path}" 
     info 'Installing cookbook dependencies with berkshelf' 
     run "berks vendor #{cookbooks_path}" 
    end 
    end 

这将执行Berkshelf在“食谱”目录,这是安装在您的游民VM和默认由流浪厨师独奏供应者用来安装所需的食谱。