1

I've updated to Vagrant 1.4.3 and am attempting to install the vagrant-berkshelf plugin. I'm getting the following error:

$ 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>'

I tried to manually install minitar with both the system and Vagrant-specific rubies. System ruby installed it just fine. When I manually installed it into the Vagrant ruby, I got the following:

$ 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

But, I still get the exact same error. I've tried to manually install every gem in the Gemfile from the vagrant-berkshelf github repo and still cannot install.

4

3 回答 3

4

我在https://github.com/berkshelf/vagrant-berkshelf/issues/140中询问并收到以下答案。

这与 vagrant-chef-librarian 的依赖存在冲突。解决方案是使用以下命令手动安装 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

我错过的一点是安装目录。

于 2014-01-13T18:37:54.933 回答
2

显然, Vagrant Berkshelf 已于5 天前退休。

要将 Chef 与 Vagrant 一起使用,这里有一篇很好的文章

请注意该页面上的“注意”:

注意:从 1 月 28 日星期二开始,Vagrantfile 和 vagrant-bershelf 插件将被停用您可以使用第 3 部分中介绍的 Test Kitchen 及其 .kitchen.yml 来完成本文中提到的所有事情(vagrant up、vagrant provision 等)这个系列的。考虑跳到第 3 部分,现在就开始使用 Test Kitchen。本文将仅出于历史目的而保留。

因此,请点击此链接并使用 Test Kitchen 而不是 Vagrant Berkshelf。我还没有尝试过,但我和你在同一条船上——希望让 Chef Solo 与 Vagrant 一起工作。

于 2014-02-02T18:11:35.297 回答
1

到目前为止,Test Kitchen 设置无法完成所有操作,例如多机设置。您可以将 vagrant-berkshelf 替换为本地 Berkshelf 安装,并使用 vagrant-triggers 在“vagrant up”或“vagrant provision”上进行食谱销售。

我写了一篇关于它的简短博客文章

基本上可以归结为:

  • 安装 Ruby/Berkshelf
  • 安装 vagrant-triggers Vagrant 插件
  • 使用 vagrant-trigger 在目录中供应食谱
  • 运行 Vagrant chef-solo provisioner

以下 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 以在“cookbook”目录中安装所需的食谱,该目录安装在您的 vagrant VM 中,默认情况下由 Vagrant chef-solo 供应商使用。

于 2014-07-07T13:21:08.913 回答