stream浪汉和docker工不是很好

更新:我已经卸载Vagrant和Docker,并会接受任何答案,帮助我重新安装他们的方式:

  1. 我可以在不依赖Docker的情况下运行Vagrant; 和
  2. 我可以在不依赖stream浪者的情况下运行Docker。 和
  3. 我可以运行Vagrant并使用Docker作为支持提供程序

如果你看看Vagrant的源代码,你会发现我的错误来自于这一行代码 ,对于VirtualBox提供者来说, 这个 代码来自于这个usable方法引发了一个错误。 如果认为VirtualBox具有无效版本( VirtualBoxInvalidVersion ),或者在本地系统( VirtualBoxNotDetected )上未检测到,则该usable方法会引发错误。

不是Ruby的开发者,现在越来越难以弄清楚Vagrant是如何决定抛出这两个错误之一的。 但是我觉得我越来越接近于搞清楚为什么Docker会占用我的Vagrant / VirtualBoxconfiguration。


原始问题:

Mac在这里。 前几天我安装了Vagrant和VirtualBox这样的:

 brew cask install virtualbox brew cask install vagrant brew cask install vagrant-manager 

这让它无所适从,没有任何问题。 我能够vagrant init hashicorp/precise32; vagrant up vagrant init hashicorp/precise32; vagrant up ,一切看起来像是运行完美( hashicorp/precise32默认使用VirtualBox)。

然后,昨天晚上我安装了Docker ,它也需要VirtualBox,然后启动并运行,没有任何问题。 我甚至能够让whalesay容器的例子工作。 到现在为止还挺好。

今天我去了Vagrant玩,看起来我的Docker安装了我的Vagrant / VirtualBoxconfiguration。

现在 ,当我在一个空目录上运行vagrant init hashicorp/precise32 ,然后运行vagrant up ,我得到:

 myuser@mymac:~/sandbox/myapp$vagrant up No usable default provider could be found for your system. Vagrant relies on interactions with 3rd party systems, known as "providers", to provide Vagrant with resources to run development environments. Examples are VirtualBox, VMware, Hyper-V. The easiest solution to this message is to install VirtualBox, which is available for free on all major platforms. If you believe you already have a provider available, make sure it is properly installed and configured. You can see more details about why a particular provider isn't working by forcing usage with `vagrant up --provider=PROVIDER`, which should give you a more specific error message for that particular provider. 

所以然后我试着指定提供者types,即使我不需要,只是为了看看会发生什么:

 myuser@mymac:~/sandbox/myapp$vagrant up --provider=VirtualBox The provider 'VirtualBox' could not be found, but was requested to back the machine 'cortex'. Please use a provider that exists. 

为了好的措施,运行vagrant -v产生Vagrant 1.7.2作为输出。

任何想法出了什么问题,是什么修复?

stream浪者关心的情况下(至less是stream浪1.8.1呢),所以使用小写的提供者名称:

 vagrant up --provider=virtualbox 

我认为1.8.1的错误信息更有帮助:

 $ vagrant up --provider=VirtualBox # NOTE: this is the WRONG capitalization An active machine was found with a different provider. Vagrant currently allows each machine to be brought up with only a single provider at a time. A future version will remove this limitation. Until then, please destroy the existing machine to up with a new provider. Machine name: default Active provider: virtualbox Requested provider: VirtualBox 

您也可以在您的Vagrantfile中设置默认提供程序。

我遇到了同样的问题,并通过将Vagrant更新到最新版本(1.7.2,更新到1.8.1)来修复它。

我得到了这个工作,但不知道实际的解决scheme是什么。

  1. 卸载Vagrant和Docker
  2. 手动重新安装Vagrant(不通过brew/cask
  3. 从这个链接重新安装Docker
  4. 使用这个Vagrantfile来确认你的Vagrant-Docker-VirtualBox能够很好的协同工作

我无法重现这个问题。 但是,我从Vagrant的VirtualBox提供程序中读取了一些源代码。 这听起来像它可能无法find$PATH VBoxManage 。 它应该位于/usr/bin/VBoxManage ,即使通过Homebrew安装。 机会是你的$ PATHvariables是不正确的,或者VBoxManage是在别的地方。

其他有相同问题的读者应该:

  • 检查/etc/paths以确保列出了/usr/bin ,以及通常在$ PATH中find的所有其他目录。
  • 查找名为~/.bashrc~/.bash_profile 。 Mac OS X在默认情况下不附带任何一个文件,但有些用户添加它们来自定义bash,有些程序可能会尝试自动编辑/创build它们。 警惕任何看起来像export PATH=... 。 在OS X上,对$ PATH的更改应在/etc/paths/etc/paths.d/* ,而不是在bash脚本中。
  • 运行type -a VBoxManage查看名为VBoxManage的可执行文件的所有已知位置。 可能有一个stream浪的二进制文件优先于真正的二进制文件。