我在我的环境中使用Vagrant,我遇到了一个小问题:

$vagrant up

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'base' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
==> default: Adding box 'base' (v0) for provider: virtualbox
    default: Downloading: base

An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.

Couldn't open file /Users/.../base

我已经初始化了我的项目与流浪者初始化,但出于某种原因流浪者拒绝工作。


当前回答

对我来说,我在运行时遇到了一个错误(我使用的是Macbook pro, Mac OS: 10.12.1):

下载远程文件时发生错误。错误消息(如果有的话)如下所示。请修复此错误,然后重试。 无法打开文件…

我试图删除我文件夹中的Vagrantfile,然后运行:

Vagrant init hashicorp/precise64

然后:

流浪汉了

它可以解决我的问题。希望这篇文章能对那些面临同样问题的人有所帮助。

其他回答

请在你的终端上运行:

$ vagrant box list

您将看到类似laravel/homestead(virtualbox,x.x.x)的内容。

接下来找到你的Vagrantfile,找到上面写着的那行

config.vm.box = "box"

运行流浪箱列表时,将箱替换为箱名。

我在运行以下命令时也遇到了同样的问题

vagrant init
vagrant up  
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'base' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
==> default: Box file was not detected as metadata. Adding it directly...
==> default: Adding box 'base' (v0) for provider: virtualbox
    default: Downloading: base
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.

Couldn't open file /home/...../base

我用

>vagrant init laravel/homestead
>Vagrant up

这对我很管用。

快乐的编码

如果“Vagrantfile”已经在这个目录中存在。在运行“vagrant init”之前删除它。 错误显示

1. rm Vagrantfile
2. vagrant init hashicorp/precise64
3. vagrant up

当你做vagrant init时,它会替换你的repo中的vagrant文件,并给你这个错误。所以我建议你从远程复制原始的vagrant文件或备份的vagrant文件,然后试试vagrant。

我遇到了同样的问题,我只是从我的远程回购复制了流浪者文件,并替换了我试图运行的流浪者文件。这将使流浪文件中的配置与虚拟机同步。

编辑vagrant init在同一目录下创建的vagrant文件,并在config.vm.box = "ubuntu/trusty64"行中输入盒子的名称,其中ubuntu/trusty64是你的基本盒子。现在vagrant up将下载并设置ubuntu/trusty64为你的基础框。