盒子 'laravel/homestead' 无法找到。

4

尝试配置laravel 5.1。

克隆laravel/homestead

将其克隆到Home目录后,尝试运行以下vagrant up命令时会出现错误:

user@user:~/laravel/homestead$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
There are errors in the configuration of this machine. Please fix
the following errors and try again:

vm:
* The box 'laravel/homestead' could not be found.

I first tried with vagrant box add laravel/homestead

This command was not invoked properly. The help for this command is
available below.

Usage: vagrant box add <name> <url> [--provider provider] [-h]

        --checksum VALUE             Checksum
        --checksum-type VALUE        Checksum type
    -c, --clean                      Remove old temporary download if it exists.
    -f, --force                      Overwrite an existing box if it exists.
        --insecure                   If set, SSL certs will not be validated.
        --cacert certfile            CA certificate
        --cert certfile              The client SSL cert
        --provider provider          The provider that backs 

Also tried passing url as the error shown, still failed. Atlast cloned from the git repo

1. vagrant -v : Vagrant 1.4.3

2. vagrant box add laravel/homestead https://atlas.hashicorp.com/laravel/boxes/homestead

错误:

Downloading box from URL: https://atlas.hashicorp.com/laravel/boxes/homestead
Extracting box...e: 0/s, Estimated time remaining: --:--:--)
The box failed to unpackage properly. Please verify that the box
file you're trying to add is not corrupted and try again. The
output from attempting to unpackage (if any):

bsdtar: Error opening archive: Unrecognized archive format

3. 家园:

Laravel Homestead version 2.0.17

Usage:
  command [options] [arguments]

Options:
  -h, --help            Display this help message
  -q, --quiet           Do not output any message
  -V, --version         Display this application version
      --ansi            Force ANSI output
      --no-ansi         Disable ANSI output
  -n, --no-interaction  Do not ask any interactive question
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Available commands:
  destroy    Destroy the Homestead machine
  edit       Edit the Homestead.yaml file
  halt       Halt the Homestead machine
  help       Displays help for a command
  init       Create a stub Homestead.yaml file
  list       Lists commands
  provision  Re-provisions the Homestead machine
  resume     Resume the suspended Homestead machine
  run        Run commands through the Homestead machine via SSH
  ssh        Login to the Homestead machine via SSH
  status     Get the status of the Homestead machine
  suspend    Suspend the Homestead machine
  up         Start the Homestead machine
  update     Update the Homestead machine image

我做错了什么?

如果您直接尝试添加盒子会发生什么? vagrant box add laravel/homestead - Konstantin
@Alik - 我更新了我的问题,请查看。 - Mithun Shreevatsa
è؟کè¦پو·»هٹ وœ‰ه…³vagrant版وœ¬vagrant -vçڑ„ن؟،وپ¯م€‚vagrant box add laravel/homestead https://atlas.hashicorp.com/laravel/boxes/homestead输ه‡؛çڑ„ç،®هˆ‡هگ«ن¹‰وک¯ن»€ن¹ˆï¼ں - Konstantin
看起来你错过了一些步骤- 你是在遵循文档吗?http://laravel.com/docs/5.1/homestead安装过程似乎自版本5.0以来已经发生了变化。 - edcs
@Mithun 的链接确实存在。我刚刚通过发出 wget http://atlas... 进行了测试,它重定向到 http://cabinet.laravel.com/homestead-0-2-6-vb.box。你可以尝试这个链接,但你应该更新你的 vagrant 而不是尝试使用 1.4.x 来拉取它。 - Konstantin
显示剩余9条评论
2个回答

4

请更新您的Vagrant。Vagrant Cloud是在1.5 IRC版本中引入的,因此您的vagrant不知道如何处理vagrant box add laravel/homestead这样的命令。


2

下载 Homestead 的正确命令是添加完整的 URL。
您可以使用此 VM Box,它是最新版本,直到现在为止。
https://atlas.hashicorp.com/laravel/boxes/homestead/versions/0.4.1/providers/virtualbox.box
如果您想更改为其他版本或者有更新的版本,只需更改版本号即可。
因此,命令应该像这样:

vagrant box add laravel/homestead https://atlas.hashicorp.com/laravel/boxes/homestead/versions/0.4.1/providers/virtualbox.box

the command was for virtual box and if you have low internet speed you can download it from URL and after finished you can use path on your local pc instead of URL.
and if you still face problem try to uninstall vagrant by use this command

rm -rf /opt/vagrant
rm -f /usr/bin/vagrant

Linux用户使用以下指令。如果问题仍然存在,请尝试删除位于~/.vagrant.d的文件夹。其他操作系统请参考此链接。卸载后,您可以下载并重新安装Vagrant。
最后,请确保在主目录中使用所有命令。
祝好!


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