1、安装原生PHP
下载/解压 PHP
到 PHP 下载页下载最新版本的 PHP(如果使用 Laravel 5.1 的话需要 PHP 5.5.9+ 版本),解压下载的zip格式压缩文件到本地目录,比如E:\Php
。
编辑 php.ini
打开命令行按照如下步骤创建php.ini
文件:
C:\Users\Test>E: E:\>cd Php E:\Php> copy php.ini-development php.ini
然后在编辑 php.ini
:
// 将 ; extension_dir = "ext" // 修改为 extension_dir = "ext" // 将 ;extension=php_openssl.dll // 修改为 extension=php_openssl.dll // 将 ;extension=php_mbstring.dll // 修改为 extension=php_mbstring.dll
现在,在 E:\php
目录下,可以执行 php
命令:
添加E:\Php到用户变量
1)打开Windows控制面板,在顶部右侧搜索框搜索”环境变量“:
2)点击”编辑账户的环境变量“:
3)双击PATH那一行然后将;E:\Php
添加到弹出框的变量值中:
下一次打开命令行时,php.exe
已经在用户变量中,可以在任何地方直接执行php
命令而不需要指定绝对路径。
如果执行php
命令时报错:
对应解决办法:http://jingyan.baidu.com/article/4f7d57129fa86e1a201927de.html。
2、安装 Node.js
我们将会在本地安装 Node.js 以便后续使用 gulp。
到 Nodejs 下载页下载 Windows 系统对应版本安装。
使用默认设置安装,安装完成后打开新的命令行使用如下命令检查安装是否成功:
全局安装gulp
npm install -g gulp
安装完成后检查gulp版本:
全局安装bower
npm install -g bower
安装完成后检查bower版本:
3、安装Composer
Composer是PHP包依赖管理器。
去 Composer 下载页下载 Windows 版本安装程序。使用默认设置安装,如果问你PHP安装路径,输入:
E:\Php\php.exe
安装完成后,关掉当前的命令行并打开一个新的,检查Composer版本验证是否安装成功:
安装过程中会将E:\Php
从用户变量移动到系统变量,并添加C:\ProgramData\ComposerSetup\bin
到系统路径。
4、安装GIT并设置SSH Key
在 Windows 中我们将会安装本地 Git 软件并只使用其提供的 Git Bash 设置 SSH Key,任何其它对git的使用都通过命令行实现。
安装Git
下载git安装器
到git下载页下载 Windows 版安装。
安装
运行下载的安装文件并一路选择默认选项直到这个页面:
确保选择“Use Git from the Windows Command Prompt”选项。
余下部分继续选择默认选项进行安装即可。
检查Git版本
关闭所有命令行窗口,然后打开一个新的命令行窗口,运行如下命令确保Git安装成功:
设置SSH Key
在 Windows 开始菜单找到 Git Bash 并运行,在打开的窗口中执行 ssh-keygen
命令,一路回车使用默认选项来设置SSH Key:
$ ssh-keygen -t rsa -C "your@email.com" Generating public/private rsa key pair. Enter file in which to save the key (/c/Users/LaravelAcademy/.ssh/id_rsa): Created directory '/c/Users/LaravelAcademy/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: $
5、添加 Homestead Vagrant 盒子
下面我们会下载 Laravel Homestead Vagrant 盒子:
C:\Users\LaravelAcademy> vagrant box add laravel/homestead ==> box: Loading metadata for box 'laravel/homestead' box: URL: https://vagrantcloud.com/laravel/homstead
这一步可能需要消耗较长时间,具体取决与你的网络连接速度。
6、安装 Homestead
使用 Composer 安装
现在让我们使用 Composer 安装 Homestead :
C:\Users\LaravelAcademy> composer global require "laravel/homestead=~2.0" Changed current directory to C:\Users/LaravelAcademy/AppData/Roaming/Composer ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) - Installing symfony/process (v2.7.7) Downloading: 100% - Installing symfony/console (v2.7.7) Downloading: 100% - Installing laravel/homestead (v2.1.8) Downloading: 100% symfony/console suggests installing symfony/event-dispatcher () symfony/console suggests installing psr/log (For using the console logger) Writing lock file Generating autoload files
更新系统变量
Composer 会将 Homestead 安装到 Composer 安装目录下的 vendor
目录。
为了从命令行可以直接访问homestead
,将其安装路径添加到系统变量即可。和添加PHP路径到系统变量操作步骤一样,只是这一次添加的路径不一样而已:
C:\Users\YOU\AppData\Roaming\Composer\vendor\bin;vendor\bin
具体路径根据你的本地路径来。
注意:这里我们添加
vendor\bin
到系统路径中,因为每一个Laravel项目都会包含这一目录,将其添加到系统变量后我们就可以在项目根目录下直接使用项目提供的依赖包。
验证Homestead安装
系统变量修改后需要重新打开新的命令行窗口才会生效,所以我们再一次关闭所有命令行窗口并打开一个新的,然后检查 Homestead 版本已验证是否安装成功:
初始化 Homestead
安装完 Homestead 并添加 Composer 的 bin
目录到系统变量后,需要初始化 Homestead :
C:\Users\LaravelAcademy> homestead init Creating Homestead.yaml file... Homestead.yaml file created at: C:\Users\LaravelAcademy\.homestead/Homestead.yaml
记住:一台机子上只需要初始化一次 Homestead 即可。
7、启动 Homestead VM
在第一次启动 Homestead 之前我们要创建一个 Code
目录用于存放项目文件,然后使用 homestead up
命令启动虚拟机:
E:> mkdir Code E:> homestead up Bringing machine 'default' up with 'virtualbox' provider... ==> default: Checking if box 'laravel/homestead' is up to date...
如果启动过程中出现报错信息:
There was an error while executing `VBoxManage`, a CLI used by Vagrant for controlling VirtualBox. The command and stderr is shown below. Command: ["hostonlyif", "create"] Stderr: 0%... Progress state: E_FAIL VBoxManage.exe: error: Failed to create the host-only adapter VBoxManage.exe: error: Code E_FAIL (0x80004005) - Unspecified error (extended in fo not available) VBoxManage.exe: error: Context: "int __cdecl handleCreate(struct HandlerArg *,in t,int *)" at line 66 of file VBoxManageHostonly.cpp
解决办法参考:在 Windows 上进行 Laravel Homestead 安装、配置及测试
现在 Homestead 虚拟机已经运行起来了,如果你关闭这个 Windows 命令行窗口,虚拟机仍然在后台运行,除非你在命令行中运行 homestead halt
命令才会关闭虚拟机。
你可以登录到 Homestead 虚拟机,但是在 Windows 系统中不能使用 homestead ssh
,这里我们借助第三方软件 PuTTY 来登录到虚拟机。
8、使用 PuTTY 登录到 Homestead
Windows 系统并没有内置 SSH 客户端软件,因此我们需要下载一个并安装,推荐使用 PuTTY 通过 SSH 登录到虚拟机。
下载并安装 PuTTY
下载putty安装器,运行这个安装文件,一路使用默认设置即可。
保存 SSH Key
接下来在 Windows 开始菜单中找到 PuTTYgen 并点击运行,选择 Conversions 菜单然后点击 Import Key,进入之前设置 SSH Key 时id_rsa
文件所在目录并选择该文件,然后点击“Save private key”按钮。如果你想要保存不带密码的key,在同一目录下选择 id_rsa.ppk
即可。
设置 Homestead PuTTY 会话
启动 PuTTY 并设置 Connection->SSH->Auth
私有 key 为刚刚创建的id_rsa.ppk
,设置当前会话的主机名为 vagrant@127.0.0.1
,端口为2222,保存当前会话名为 homestead
:
首次运行该会话的时候会弹出一个确认会话框,但之后登录到 Homestead 虚拟机就不再需要输入密码。
你还可以在桌面上创建一个该会话的快捷方式,该快捷方式链接指向"C:\Program Files (x86)\PuTTY\Putty.exe" -load homestead
,我们将其命名为 Homestead。
修改 PuTTY 的字体
PuTTY 的默认字体是 Courier New
,在我看来很丑,可以到 PuTTY 的 Windows->Appearance
配置中修改字体、尺寸和颜色等:
通过 PuTTY 连接到 Homestead
运行刚刚在 PuTTY 创建的 homestead
会话,登录到 Homestead 后界面显示如下:
Using username "vagrant". Authenticating with public key "imported-openssh-key" Welcome to Ubuntu 14.04.2 LTS (GNU/Linux 3.13.0-24-generic x86_64) * Documentation: https://help.ubuntu.com/ Last login: Tue Nov 24 15:46:46 2015 vagrant@homestead:~$
9、安装 Laravel 安装器
最后一步我们将会 Windows 上安装 Laravel 安装器。
还是使用 Composer 安装:
C:\Users\LaravelAcademy> composer global require "laravel/installer=~1.1" Changed current directory to C:\Users/LaravelAcademy/AppData/Roaming/Composer ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) - Installing guzzlehttp/promises (1.0.3) Downloading: 100% - Installing psr/http-message (1.0) Downloading: 100% - Installing guzzlehttp/psr7 (1.2.1) Downloading: 100% - Installing guzzlehttp/guzzle (6.1.1) Downloading: 100% - Installing laravel/installer (v1.2.2) Downloading: 100% Writing lock file Generating autoload files
由于我们在之前已经设置过了系统变量,这里 laravel
命令可以直接从命令行中运行,我们可以查看其版本:
好了,至此我们已经迈出了万里长征第一步 —— 成功在 Windows 上安装并设置好了本地开发环境,这将为我们后续使用 Laravel 5.1 开发博客应用打下坚实基础。
我在linux各种装完情况下,重装win7安装,网上查看是有因为cpu没有vt-x,不支持;准备找一台有的电脑试一下;
查看cpu是否支持,是在bios里的advanced 查看cpu配置可以看到
修改了php.ini 查看php版本为什么会报php不是内部或外部命令,也不是可运行的程序或批处理文件的错啊 小白 求问
各种报错这是什么鬼教程C:Userslao>homestead upBringing machine ‘default’ up with ‘virtualbox’ provider…==> default: Importing base box ‘laravel/homestead’…[K==> default: Matching MAC address for NAT networking…==> default: Setting the name of the VM: homestead==> default: Clearing any previously set network interfaces…==> default: Destroying VM and associated drives…D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/plugins/providers/virtualbox/driver/version_5_1.rb:381:in `split’: invalid byte sequence in UTF-8 (ArgumentError) from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/plugins/providers/virtualbox/driver/version_5_1.rb:381:in `read_bridged_interfaces’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/plugins/providers/virtualbox/action/network.rb:275:in `hostonly_config’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/plugins/providers/virtualbox/action/network.rb:90:in `block in call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/plugins/providers/virtualbox/action/network.rb:83:in `each’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/plugins/providers/virtualbox/action/network.rb:83:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/plugins/providers/virtualbox/action/clear_network_interfaces.rb:26:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/plugins/providers/virtualbox/action/prepare_nfs_settings.rb:18:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/builtin/synced_folders.rb:87:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/builtin/synced_folder_cleanup.rb:28:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/plugins/synced_folders/nfs/action_cleanup.rb:19:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/plugins/providers/virtualbox/action/prepare_nfs_valid_ids.rb:12:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/builtin/handle_forwarded_port_collisions.rb:49:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/plugins/providers/virtualbox/action/prepare_forwarded_port_collision_params.rb:30:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/builtin/env_set.rb:19:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/builtin/provision.rb:80:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/plugins/providers/virtualbox/action/clear_forwarded_ports.rb:15:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/plugins/providers/virtualbox/action/set_name.rb:50:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/plugins/providers/virtualbox/action/clean_machine_folder.rb:17:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/plugins/providers/virtualbox/action/check_accessible.rb:18:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:95:in `block in finalize_action’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/builder.rb:116:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/runner.rb:66:in `block in run’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/util/busy.rb:19:in `busy’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/runner.rb:66:in `run’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/builtin/call.rb:53:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:95:in `block in finalize_action’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/builder.rb:116:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/runner.rb:66:in `block in run’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/util/busy.rb:19:in `busy’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/runner.rb:66:in `run’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/builtin/call.rb:53:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:95:in `block in finalize_action’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/builder.rb:116:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/runner.rb:66:in `block in run’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/util/busy.rb:19:in `busy’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/runner.rb:66:in `run’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/builtin/call.rb:53:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/builtin/box_check_outdated.rb:36:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/builtin/config_validate.rb:25:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/plugins/providers/virtualbox/action/check_virtualbox.rb:17:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:95:in `block in finalize_action’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/plugins/providers/virtualbox/action/match_mac_address.rb:19:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/plugins/providers/virtualbox/action/discard_state.rb:15:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/plugins/providers/virtualbox/action/import.rb:74:in `import’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/plugins/providers/virtualbox/action/import.rb:13:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/plugins/providers/virtualbox/action/prepare_clone_snapshot.rb:17:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/builtin/prepare_clone.rb:15:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/plugins/providers/virtualbox/action/customize.rb:40:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/plugins/providers/virtualbox/action/check_accessible.rb:18:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:95:in `block in finalize_action’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/builder.rb:116:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/runner.rb:66:in `block in run’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/util/busy.rb:19:in `busy’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/runner.rb:66:in `run’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/builtin/call.rb:53:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/builtin/config_validate.rb:25:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:95:in `block in finalize_action’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/builtin/handle_box.rb:56:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:95:in `block in finalize_action’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/builder.rb:116:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/runner.rb:66:in `block in run’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/util/busy.rb:19:in `busy’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/runner.rb:66:in `run’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/builtin/call.rb:53:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/plugins/providers/virtualbox/action/check_virtualbox.rb:17:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/builder.rb:116:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/runner.rb:66:in `block in run’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/util/busy.rb:19:in `busy’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/runner.rb:66:in `run’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/machine.rb:225:in `action_raw’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/machine.rb:200:in `block in action’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/environment.rb:567:in `lock’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/machine.rb:186:in `call’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/machine.rb:186:in `action’ from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/batch_action.rb:82:in `block (2 levels) in run’
我也报了类似的错误
最后你们是怎么解决的,我也是报这个错误
我下载最新的virtualbox.box 并且修改安装①config.vm.box_version = settings[“version”] ||= “>= 0.4.0″②To circumvent around this you could create a metadata.json file locally in the same directory as your downloaded box file. e.g:{ “name”: “laravel/homestead”, “versions”: [{ “version”: “0.4.0”, “providers”: [{ “name”: “virtualbox”, “url”: “file://homestead.box” }] }]}Then run vagrant box add metadata.json然后执行启动命令homestead up时候报错G:boxes>homestead upBringing machine ‘default’ up with ‘virtualbox’ provider…==> default: Importing base box ‘laravel/homestead’…[K==> default: Matching MAC address for NAT networking…==> default: Checking if box ‘laravel/homestead’ is up to date…==> default: There was a problem while downloading the metadata for your box==> default: to check for updates. This is not an error, since it is usually due==> default: to temporary network problems. This is just a warning. The problem==> default: encountered was:==> default:==> default: Couldn’t open file /boxes/metadata.json==> default:==> default: If you want to check for box updates, verify your network connection==> default: is valid and try again.==> default: Setting the name of the VM: homestead==> default: Clearing any previously set network interfaces…==> default: Destroying VM and associated drives…求原因