Macos 流浪汉和码头工人玩得不好
更新:我已卸载Vagrant和Docker,并将接受任何有助于我以以下方式重新安装它们的答案:Macos 流浪汉和码头工人玩得不好,macos,docker,vagrant,Macos,Docker,Vagrant,更新:我已卸载Vagrant和Docker,并将接受任何有助于我以以下方式重新安装它们的答案: 我可以在不依赖码头工人的情况下流浪;及 我可以经营Docker而不依赖流浪汉;及 我可以运行Vagrant并使用Docker作为支持提供商 如果您查看流浪的源代码,您将看到我的错误来自,对于VirtualBox提供者来说,这是由于引发了一个错误。如果该available方法认为VirtualBox的版本无效(VirtualBox ValidVersion),或者在本地系统上未检测到该版本(Virtua
available
方法认为VirtualBox的版本无效(VirtualBox ValidVersion
),或者在本地系统上未检测到该版本(VirtualBox NotDetected
),则会引发错误
作为一个Ruby开发人员,我现在很难弄清楚Vagrant是如何决定抛出这两个错误中的任何一个的。但我想我越来越接近于弄明白为什么Docker用软管冲洗我的流浪者/虚拟箱配置
原始问题: 我是麦克。几天前,我安装了VirtualBox,如下所示:
brew cask install virtualbox
brew cask install vagrant
brew cask install vagrant-manager
…这让它游手好闲,毫无问题。我能够hashicorp/precise32的阴道炎;vagrant up
,一切看起来都运行得很完美(hashicorp/precise32
默认使用VirtualBox)
然后昨晚我安装了它,它也需要VirtualBox,并且安装并运行起来没有任何问题。我甚至能够让whalesay
容器示例正常工作。到目前为止还不错
今天我去Vagrant玩了一圈,看起来我的Docker安装在我的Vagrant/VirtualBox配置中
现在,当我在一个空目录上运行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.
因此,我尝试指定提供者类型,尽管我不必这样做,只是为了看看会发生什么:
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
作为输出
你知道哪里出了问题,解决的办法是什么吗?我让它工作了,但不知道实际的解决办法是什么
brew/cask
)我无法重现这个问题。不过,我从Vagrant的VirtualBox提供商那个里读了一些源代码。听起来它可能在
$PATH
中找不到VBoxManage
。它应该位于/usr/bin/VBoxManage
,即使是通过自制软件安装的。您的$PATH变量可能不正确,或者VBoxManage在其他地方
其他有同样问题的读者应:
- 选中
,确保列出了/etc/paths
,以及通常在$PATH中找到的所有其他目录/usr/bin
- 查找名为
或~/.bashrc
的文件。默认情况下,Mac OS X不附带这两个文件中的任何一个,但有些用户添加它们以自定义bash,有些程序可能会尝试自动编辑/创建它们。小心任何看起来像导出路径=…的行。在OSX上,对$PATH的更改应该在~/.bash\u profile
和/etc/paths
中进行,而不是在bash脚本中进行/etc/paths.d/*
- 运行
查看名为type-a VBoxManage
的可执行文件的所有已知位置。某个地方可能有一个游离的二进制,它优先于真实的二进制VBoxManage
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
你也可以在你的vagrant文件中设置一个默认的提供程序。我在安装docker toolbox后遇到了类似的问题,并在运行这个命令后修复了这个问题。
rm-r~/.vagrant.d/plugins.json~/.vagrant.d/gems
谢谢@BMW,但这对我不起作用。建议Ubuntu 12.04与docker一起玩,因为docker需要Linux内核3.13+。虽然您可以运行sudo-apt-get-update&&sudo-apt-get-install-linux-image-generic-lts-trusty
来升级其中的内核,但我仍然建议您使用Ubuntu 14.04。似乎您的virtualbox感知有问题,请尝试手动下载并安装。您是如何安装Docker的?你用过这个吗?也许重新安装Vagrant,然后安装instal Docker——但这次是定制安装,而不是安装VirtualBox(请参阅)。现在,1.7.2是bologna,现在都是1.8.1。