Vagrant,无法下载box

6

我不确定为什么会出现这个问题,但我无法添加vagrant box。

我正在使用Windows 10,在powershell和简单的命令提示符上尝试过。同样的问题。这是一个相对较新的Windows安装。也许我缺少一些必要的软件包?

首先,我尝试了这个命令:

vagrant box add hashicorp/precise32

然后遇到了错误:

The box 'hashicorp/precise32' could not be found or
could not be accessed in the remote catalog. If this is a private
box on HashiCorp's Atlas, please verify you're logged in via
`vagrant login`. Also, please double-check the name. The expanded
URL and error message are shown below:

URL: ["https://atlas.hashicorp.com/hashicorp/precise32"]
Error:

我手动下载了这个盒子并尝试了以下操作:

vagrant box add base64 file:///D:/downloads/vagrant_boxes/precise64.box

我又遇到了这个错误:

==> box: Box file was not detected as metadata. Adding it directly...
==> box: Adding box 'base64' (v0) for provider:
    box: Unpacking necessary files from: file:///D:/downloads/vagrant_boxes/precise64.box
    box:
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.

你使用的 Vagrant 版本是哪个? - Frederic Henri
7个回答

6

当前版本(截止本日期)的OSX库不支持Vagrant 1.8.7搭载的curl版本。我安装了1.8.6,一切都很顺利。为了验证这个理论:

cd /opt/vagrant/embedded/bin
./curl --help

如果你得到一个“正常”的回复,那么你应该没问题,否则可能有其他问题。

4

自从我安装vagrant 1.8.1以来,我一直在解决这个问题,我尝试了安装更低版本的vagrant,但是遇到了同样的问题。希望我可以在这里解决它:

首先确保您已安装Microsoft Visual C++ 2010 SP1可再发行组件。 64位版本在此处:https://www.microsoft.com/zh-cn/download/details.aspx?id=13523 接下来,在我的情况下下载curl的ssl版本,也是64位。 在这里: https://curl.haxx.se/latest.cgi?curl=win64-ssl-sspi

现在将curl.exe提取到C:\ Vagrant \ embedded \ bin中。 请查看您的安装目录。

然后完成。 如果您不使用ssl,请尝试不使用ssl的curl版本。 希望有所帮助


整天都在寻找解决方案,只有您的建议才有所帮助! - evgpisarchik
只需将Vagrant的curl替换为官方SSL版本即可解决我的问题。谢谢 :) - Bruno Finger

4

在这件事发生时,我正在使用vagrant v1.8.0版本。当天稍晚,vagrant v1.8.1版本发布了。我没有尝试该版本,而是回退到v1.7.4版本,问题就解决了。


你真是救命恩人!我也遇到了同样的问题,一直以为是我在带空格的文件夹中安装Vagrant导致的。重复安装了几次应用程序,直到偶然发现这个解决方法! - Niklas Ekman

1

1

检查 C:\HashiCorp\Vagrant\embedded\bin\curl.exe 是否出错,如果是,则这就是你的问题。

要解决问题,只需下载 gitbash、console2、cmder 等,这些都已经安装了 curl,或者尝试 http://www.confusedbycode.com/curl/

但强烈推荐使用 gitbash 或 cmder。


0

对于重新安装 Vagrant 新版本无法解决问题的 MacOS 用户:

sudo mv /opt/vagrant/embedded/lib/libiconv.2.dylib /opt/vagrant/embedded/lib/libiconv.2.dylib_
brew install libiconv
brew link --force libiconv

致谢:https://github.com/mitchellh/vagrant/issues/5782


-1

你不需要添加盒子。可以使用Init代替:

vagrant init hashicorp/precise32
vagrant up
vagrant ssh

希望它能自动添加到框列表中。 如果您想设置本地框,请按照以下几个步骤添加:
D:
cd downloads/vagrant_boxes
vagrant box add base64 precise64.box
vagrant up
vagrant ssh

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接