Vagrant 安装错误

Vagrant 安装错误,vagrant,chef-infra,berkshelf,Vagrant,Chef Infra,Berkshelf,我正试图在MacOSX上安装一个新版本的Vagrant,它有一个灯堆和一个Chef。我已经安装了chef dk、vagrant和virtual box。我已经安装了precise32盒(vagrant盒添加precise32)和berkshelf(gem安装berkshelf以及:vagrant插件安装vagrant berkshelf)。我已尝试删除所有内容并重新安装,但不断出现以下错误: # vagrant up Bringing machine 'default' up with 'vi

我正试图在MacOSX上安装一个新版本的Vagrant,它有一个灯堆和一个Chef。我已经安装了chef dk、vagrant和virtual box。我已经安装了precise32盒(vagrant盒添加precise32)和berkshelf(gem安装berkshelf以及:vagrant插件安装vagrant berkshelf)。我已尝试删除所有内容并重新安装,但不断出现以下错误:

# vagrant up

Bringing machine 'default' up with 'virtualbox' provider...
/private/var/root/.vagrant.d/gems/gems/vagrant-berkshelf-3.0.1/lib/berkshelf/vagrant/config.rb:70:in `expand_path': can't convert Berkshelf::Vagrant::ChefConfig::Proxy to String (Berkshelf::Vagrant::ChefConfig::Proxy#to_str gives Berkshelf::Vagrant::ChefConfig::Proxy) (TypeError)
        from /private/var/root/.vagrant.d/gems/gems/vagrant-berkshelf-3.0.1/lib/berkshelf/vagrant/config.rb:70:in `validate'
        from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/config/v2/root.rb:68:in `block in validate'
        from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/config/v2/root.rb:64:in `each'
        from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/config/v2/root.rb:64:in `validate'
        from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builtin/config_validate.rb:15:in `call'
        from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:in `call'
        from /private/var/root/.vagrant.d/gems/gems/vagrant-berkshelf-3.0.1/lib/berkshelf/vagrant/action/configure_chef.rb:13:in `call'
        from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:in `call'
        from /private/var/root/.vagrant.d/gems/gems/vagrant-berkshelf-3.0.1/lib/berkshelf/vagrant/action/load_shelf.rb:13:in `call'
        from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:in `call'
        from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builtin/env_set.rb:19:in `call'
        from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:in `call'
        from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
        from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:in `call'
        from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:in `call'
        from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builtin/handle_box.rb:56:in `call'
        from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:in `call'
        from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
        from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:in `call'
        from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:in `call'
        from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builder.rb:116:in `call'
        from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/runner.rb:66:in `block in run'
        from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/util/busy.rb:19:in `busy'
        from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/runner.rb:66:in `run'
        from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builtin/call.rb:53:in `call'
        from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:in `call'
        from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/plugins/providers/virtualbox/action/check_virtualbox.rb:17:in `call'
        from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:in `call'
        from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builder.rb:116:in `call'
        from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/runner.rb:66:in `block in run'
        from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/util/busy.rb:19:in `busy'
        from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/runner.rb:66:in `run'
        from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/machine.rb:196:in `action_raw'
        from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/machine.rb:173:in `block in action'
        from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/environment.rb:434:in `lock'
        from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/machine.rb:161:in `call'
        from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/machine.rb:161:in `action'
        from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/batch_action.rb:82:in `block (2 levels) in run'

有什么想法吗?

我们已经在评论中讨论了答案,我很高兴这只是一个路径问题。我在这个网站的任何地方都没有看到您的特定错误消息,所以把它留给其他人可能会有用

对于其他来到这里的人来说,这个问题是由于ChefDK和您可能安装的任何其他版本的Ruby和berkself之间的冲突造成的。因此,请确保:

没有安装其他版本的Berkself

您已经安装了
vagrant插件

这两行在.bash_配置文件的底部附近,因此在路径的开始处会遇到ChefDK:

export PATH=/opt/chefdk/bin:$PATH
eval "$(chef shell-init bash)"
与RVM、chruby或其他ruby安装没有冲突。如果在.bash_配置文件中有以下类似的行,请尝试注释它们:

# Comment out chruby
# source /usr/local/opt/chruby/share/chruby/chruby.sh
# source /usr/local/opt/chruby/share/chruby/auto.sh
# chruby ruby-1.9

运行
which berks
,或
which ruby
,应该会产生一个以
/opt/chefdk/

开头的响应,尽管我的错误消息有所不同,但我也遇到了与此设置相关的问题。在您的路径中可能存在冲突-例如,Berkshelf捆绑在Chef DK中,但您也将其作为gem安装。您的路径是什么样子的?好的,我可以通过删除chefdk和bershelf,然后重新安装chefdk来修复它。是gem安装和chef中包含的安装冲突导致了错误。谢谢你的帮助!