因此我vagrant box add laravel/homestead
在主目录 (C:\Users\User Name) 中执行了此操作并得到了以下结果:
==> box: Loading metadata for box 'laravel/homestead'
box: URL: https://atlas.hashicorp.com/laravel/homestead
==> box: Adding box 'laravel/homestead' (v0.5.0) for provider: virtualbox
box: Downloading: https://atlas.hashicorp.com/laravel/boxes/homestead/versions/0.5.0/providers/virtualbox.box
box: Progress: 100% (Rate: 11.3M/s, Estimated time remaining: --:--:--)
==> box: Successfully added box 'laravel/homestead' (v0.5.0) for 'virtualbox'!
然后,我在该目录中执行操作vagrant up
并收到以下错误:
A Vagrant environment or target machine is required to run this
command. Run `vagrant init` to create a new Vagrant environment. Or,
get an ID of a target machine from `vagrant global-status` to run
this command on. A final option is to change to a directory with a
Vagrantfile and to try again.
我需要做什么vagrant init
?https://laravel.com/docs/5.3/homestead没有提到这一点。根据我的 Google 搜索,它似乎vagrant init
是用于从头开始创建新的盒子 - 而不是用于重新使用您下载的盒子。
答案1
vagrant init laravel/homestead
我想我需要在做完之后再做vagrant box add laravel/homestead
。似乎https://laravel.com/docs/5.3/homestead值得一提的是..