我正在尝试使用LAMP堆栈和Mac OSX上的Chef安装新版本的Vagrant。我安装了chef-dk,vagrant和virtual box。我已经安装了exact32 box(vagrant box add precise32 http://files.vagrantup.com/precise32.box)和berkshelf(gem install berkshelf以及:vagrant plugin install 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'
这里有什么想法吗?
答案 0 :(得分:0)
我们已经在评论中讨论了答案,我很高兴这只是一个PATH问题。我在本网站的其他任何地方都没有看到您的特定错误消息,因此将其留给其他人可能会有用。
对于到达此处的任何其他人,问题是由于ChefDK与您可能安装的任何其他版本的Ruby和Berkshelf之间的冲突。所以请确保:
没有安装其他版本的Berkshelf。
您已将vagrant-berkshelf
安装为vagrant插件
这两行位于.bash_profile底部/附近,因此在PATH开头会遇到ChefDK:
export PATH=/opt/chefdk/bin:$PATH
eval "$(chef shell-init bash)"
与RVM,chruby或其他ruby安装没有冲突。如果您的.bash_profile中有以下任何行,请尝试将其注释掉:
# 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/