• 技术文章 >后端开发 >php教程

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

    2016-06-06 20:17:03原创1119

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

    代码如下:

    ➜  ~ 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: <= 0.3.0
        
        
        

    已安装:

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

    vagrant up可以正常启动

    ➜  ~ 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.

    回复内容:

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

    代码如下:

    ➜  ~ 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: <= 0.3.0
        
        
        

    已安装:

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

    vagrant up可以正常启动

    ➜  ~ 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.

    打开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核实处理。
    专题推荐:laravel homestead php
    上一篇:php密码加密速度较慢 下一篇:自己动手写 PHP MVC 框架(40节精讲/巨细/新人进阶必看)

    相关文章推荐

    • 一文详解PHP用流方式实现下载文件(附代码示例)• PHP反序列化入门总结(小白必看)• PHP原生类的总结分享• 聊聊PHP escapeshellarg函数使用的中文问题• 分享PHP函数使用小工具(附代码示例)
    1/1

    PHP中文网