Vagrant box 无法在远程目录中找到或访问 - curl 版本不兼容。

87
我刚刚下载了Vagrant并进行了设置以及安装虚拟盒子。我只是无法启动我的项目(vagrant up)。我有一个vagrant文件等等。我该怎么办?

我刚刚下载了Vagrant并且设置好了,还安装了虚拟机。但是我现在无法启动我的项目(vagrant up)。我已经有了一个vagrant文件等等。请问我该怎么办?

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'scotch/box' could not be found. Attempting to find and install
...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
The box 'scotch/box' 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/scotch/box"] 

5
不,这种情况下红色的错误信息并没有帮助,因为它并没有打印出实际的错误。运行VAGRANT_LOG=DEBUG vagrant up以获取有用的输出。 - Michael Lihs
6个回答

216

似乎在vagrant 1.8.7和嵌入式curl版本与mac os二进制文件(默认情况下在mac os Sierra和其他系统中提供)存在问题 - 删除嵌入式版本

sudo rm /opt/vagrant/embedded/bin/curl

注意:当您添加vagrant box(远程或本地)时,还需要删除嵌入的curl,因此如果在运行vagrant box add ....时出现相同的错误,请从vagrant中删除curl,它将正常工作。

1
感谢!在macOS Sierra上使用1.8.7表现良好。尽管是个麻烦的问题。 - Jimbo
1
说得太早了。Laravel / Homestead 0.6.0的实际框下载随机停顿。 - Jimbo
2
我只是想澄清一下:a) 截至2017年4月,在OSX Sierra上仍存在此问题;b) 这个修复方法有效;c) 谢谢。 - fuzzygroup
你如何“从Vagrant中删除curl”? - rubo77
那个命令 sudo rm -rf /opt/vagrant/embedded/bin/curl 的意思是,如果你运行 vagrant box add 命令,也是必要的。 - Frederic Henri
在Windows系统中,前往C:\HashiCorp\Vagrant\embedded\bin目录并将curl.exe文件重命名为curl.exe.bkp或其他名称。 - Abhishek Kumar

1

我想更新这篇文章。当我在macOS Sierra上运行Vagrant 1.8.7时,遇到了这个错误,并注意到Vagrant刚刚更新。截至Vagrant 1.9.0版本,该错误似乎已经修复。


0

我在Sierra上遇到了类似的问题(可能与额外的brew安装有关)。

尝试过sudo rm /opt/vagrant/embedded/bin/curl,但仍然出现SSLRead()返回错误-36。

尝试了http://slick.pl/kb/software/vagrant-fix-for-error-60-ssl-read/中的建议。

无论如何:

cd ~
cd .vagrant.d/tmp/
rm -rf ~/.vagrant.d/tmp/
vagrant box add --insecure laravel/homestead

安装成功。


0

0

你应该尝试将Vagrant更新到最新版本:

sudo add-apt-repository ppa:tiagohillebrandt/vagrant
sudo apt update

这将为您的实际Ubuntu版本添加存储库。如果您使用的是20.10(Groovy),请将Groovy替换为Focal并再次调用sudo apt update

然后再次安装Vagrant:

sudo apt install vagrant

并更新所有插件:

vagrant plugin update

0

我在使用MacOS Mojave和Vagrant版本1.9.3时,尝试使用centos/7盒子时遇到了同样的问题。

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'centos/7' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
The box 'centos/7' 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/centos/7"]
Error: The requested URL returned error: 404 Not Found

我升级到了Vagrant 2.2.5,一切都如预期的那样工作:

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'centos/7' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
==> default: Loading metadata for box 'centos/7'
    default: URL: https://vagrantcloud.com/centos/7
==> default: Adding box 'centos/7' (v1902.01) for provider: virtualbox
    default: Downloading: https://vagrantcloud.com/centos/boxes/7/versions/1902.01/providers/virtualbox.box
    default: Download redirected to host: cloud.centos.org
==> default: Successfully added box 'centos/7' (v1902.01) for 'virtualbox'!

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