【问题标题】:Vagrant, can't download boxVagrant,无法下载框
【发布时间】:2016-11-23 14:02:52
【问题描述】:

不知道为什么我会遇到这个问题,但我无法添加 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 ?

标签: vagrant vagrant-windows


【解决方案1】:

当前版本(截至目前)OSX 上的库不支持与 Vagrant 1.8.7 捆绑的 curl 版本。我安装了 1.8.6,一切都像冠军一样工作。测试这个理论:

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

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

【讨论】:

    【解决方案2】:

    发生这种情况时,我正在使用 vagrant v1.8.0。那天晚些时候,vagrant v1.8.1 发布了。我没有尝试,而是切换回 v1.7.4,问题就消失了。

    【讨论】:

    • 你是救生员!有同样的问题,认为这可能与我将 Vagrant 安装在带空格的文件夹中有关。重新安装了该应用程序几次,直到偶然发现解决了这个问题!
    【解决方案3】:

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

    首先确保您安装了 Microsoft Visual C++ 2010 SP1 Redistributable。 这是64位https://www.microsoft.com/en-us/download/details.aspx?id=13523 接下来,在我的情况下也下载 64 位的 curl 的 ssl 版本。这里: https://curl.haxx.se/latest.cgi?curl=win64-ssl-sspi

    现在将 curl.exe 解压缩到 C:\Vagrant\embedded\bin。请查看您的安装目录。

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

    【讨论】:

    • 整天都在寻找解决方案。只有您的建议有帮助!
    • 只需用官方 SSL 版本替换 vagrant 的 curl 就解决了我的问题。谢谢:)
    【解决方案4】:

    检查C:\HashiCorp\Vagrant\embedded\bin\curl.exe case 报错,是你的问题。

    要解决,只需下载gitbash、console2、cmder等……你已经安装了curl,或者试试http://www.confusedbycode.com/curl/

    不过强烈推荐 gitbash 或 cmder

    【讨论】:

      【解决方案5】:

      https://atlas.hashicorp.com/hashicorp/boxes/precise32 基于官方 URL .. 只有虚拟盒子提供者。 试试下面的命令: vagrant init hashcorp/precise32; vagrant up --provider virtualbox

      【讨论】:

        【解决方案6】:

        对于重新安装新版本 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

        【讨论】:

          【解决方案7】:

          您不需要添加框。初始化而不是这个:

          vagrant init hashicorp/precise32
          vagrant up
          vagrant ssh
          

          希望它会自动添加到盒子列表中。 如果您想设置本地框 - 只需几个步骤即可添加:

          D:
          cd downloads/vagrant_boxes
          vagrant box add base64 precise64.box
          vagrant up
          vagrant ssh
          

          【讨论】:

            猜你喜欢
            • 1970-01-01
            • 1970-01-01
            • 2020-03-16
            • 2018-11-03
            • 2016-05-03
            • 2014-09-17
            • 1970-01-01
            • 2016-08-06
            • 1970-01-01
            相关资源
            最近更新 更多