>  기사  >  백엔드 개발  >  已经安装'laravel/homestead' box,但是执行homestead up时提示找不到box,怎么办?

已经安装'laravel/homestead' box,但是执行homestead up时提示找不到box,怎么办?

WBOY
WBOY원래의
2016-06-06 20:17:031956검색

已经安装'laravel/homestead' box (0.4.1),但是执行homestead up时提示找不到box,还自动要下载0.3.0版本的box。怎么办?

代码如下:

<code>➜  ~ homestead up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'laravel/homestead' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: </code>

已安装:

<code>➜  ~ vagrant box list
laravel/homestead (virtualbox, 0.4.1)
</code>

vagrant up可以正常启动

<code>➜  ~ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'laravel/homestead' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Mounting shared folders...
    default: /vagrant => /Users/zyy
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> default: flag to force provisioning. Provisioners marked to run always will still run.</code>

回复内容:

已经安装'laravel/homestead' box (0.4.1),但是执行homestead up时提示找不到box,还自动要下载0.3.0版本的box。怎么办?

代码如下:

<code>➜  ~ homestead up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'laravel/homestead' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: </code>

已安装:

<code>➜  ~ vagrant box list
laravel/homestead (virtualbox, 0.4.1)
</code>

vagrant up可以正常启动

<code>➜  ~ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'laravel/homestead' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Mounting shared folders...
    default: /vagrant => /Users/zyy
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> default: flag to force provisioning. Provisioners marked to run always will still run.</code>

打开homestead.rb文件 把
config.vm.box_version = settings["version"] ||= ">= 0.4.0" 改为 config.vm.box_version = settings["version"] ||= ">= 0"

Homestead\scripts\文件夹中,打开homestead.rb文件

修改config.vm.box_version = settings["version"] ||= ">= 0.4.0"

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.