配置Laravel Homestead Vagrant box 启动服务报错
参考https://phphub.org/topics/2
根据上面提示配置,在运行vagrant up 报错如下:
<code>Administrator@LUHSQLSY0HHQ5J6 MINGW32 /e/home/vagrant/mytwitter $ 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.</code>登录后复制登录后复制
配置清单:
homestead up提示:
<code>C:\Users\Administrator\.homestead>homestead up C:/HashiCorp/Vagrant/embedded/lib/ruby/2.2.0/psych.rb:370:in `parse': (<unknown>):did not find expected '-' indicator w hile parsing a block collection at line 23 column 5 (Psych::SyntaxError) from C:/HashiCorp/Vagrant/embedded/lib/ruby/2.2.0/psych.rb:370:in`parse_stream' from C:/HashiCorp/Vagrant/embedded/lib/ruby/2.2.0/psych.rb:318:in `parse' from C:/HashiCorp/Vagrant/embedded/lib/ruby/2.2.0/psych.rb:245:in `load' from C:/Users/Administrator/AppData/Roaming/Composer/vendor/laravel/homestead/Vagrantfile:20:in`block in <top>' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/config/v2/loader.rb:37:in`call' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/config/v2/loader.rb:37:in`load' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/config/loader.rb:113:in`block (2 levels) in load' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/config/loader.rb:107:in`each' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/config/loader.rb:107:in`block in load' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/config/loader.rb:104:in`each' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/config/loader.rb:104:in`load' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/vagrantfile.rb:28:in`initialize' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/environment.rb:740:in`new' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/environment.rb:740:in`vagrantfile' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/environment.rb:486:in`host' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/environment.rb:208:in`block in action_runner' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/runner.rb:33:in`call' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/runner.rb:33:in`run' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/environment.rb:473:in`hook' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/environment.rb:722:in`unload' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/bin/vagrant:177:in`ensure in <main>' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/bin/vagrant:177:in`<main>'</main></main></top></unknown></code>登录后复制登录后复制
回复内容:
参考https://phphub.org/topics/2
根据上面提示配置,在运行vagrant up 报错如下:
<code>Administrator@LUHSQLSY0HHQ5J6 MINGW32 /e/home/vagrant/mytwitter $ 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.</code>登录后复制登录后复制
配置清单:
homestead up提示:
<code>C:\Users\Administrator\.homestead>homestead up C:/HashiCorp/Vagrant/embedded/lib/ruby/2.2.0/psych.rb:370:in `parse': (<unknown>):did not find expected '-' indicator w hile parsing a block collection at line 23 column 5 (Psych::SyntaxError) from C:/HashiCorp/Vagrant/embedded/lib/ruby/2.2.0/psych.rb:370:in`parse_stream' from C:/HashiCorp/Vagrant/embedded/lib/ruby/2.2.0/psych.rb:318:in `parse' from C:/HashiCorp/Vagrant/embedded/lib/ruby/2.2.0/psych.rb:245:in `load' from C:/Users/Administrator/AppData/Roaming/Composer/vendor/laravel/homestead/Vagrantfile:20:in`block in <top>' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/config/v2/loader.rb:37:in`call' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/config/v2/loader.rb:37:in`load' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/config/loader.rb:113:in`block (2 levels) in load' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/config/loader.rb:107:in`each' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/config/loader.rb:107:in`block in load' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/config/loader.rb:104:in`each' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/config/loader.rb:104:in`load' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/vagrantfile.rb:28:in`initialize' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/environment.rb:740:in`new' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/environment.rb:740:in`vagrantfile' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/environment.rb:486:in`host' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/environment.rb:208:in`block in action_runner' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/runner.rb:33:in`call' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/runner.rb:33:in`run' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/environment.rb:473:in`hook' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/environment.rb:722:in`unload' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/bin/vagrant:177:in`ensure in <main>' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/bin/vagrant:177:in`<main>'</main></main></top></unknown></code>登录后复制登录后复制
vagrant up
需要在 init
的目录下执行。
我一般的步骤是:
下载
virtualbox.box
文件
<code>vagrant box add laravel/homestead</code>
然后选择 virtualbox
, 会自动下载 virtualbox.box
, 但是很慢,复制一下地址然后用迅雷或者百度网盘下载。然后再执行一个 add
并指定好路径
添加
box
<code>vagrant box add laravel/homestead <path-of-virtualbox.box></path-of-virtualbox.box></code>
安装
homestead
<code>composer global require "laravel/homestead=~2.2"</code>
然后将 ~/.composer/vendor/bin
添加到环境变量
初始化,并运行
<code>homestead init homestead edit</code>
设置好共享文件夹,映射的端口,然后就可以啦。
<code>homestead up</code>
请问有在 homestead 目录 vagrant up
了吗
step1: composer require laravel/homestead
step2: ./vendor/bin/homestead make
step3: vagrant up
报错就有 vagrant init 初始化一下。 我也刚才配好这个东西
根据提示先在目录下vagrant init初始化,然后再vagrant up启动

热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章

热工具

记事本++7.3.1
好用且免费的代码编辑器

SublimeText3汉化版
中文版,非常好用

禅工作室 13.0.1
功能强大的PHP集成开发环境

Dreamweaver CS6
视觉化网页开发工具

SublimeText3 Mac版
神级代码编辑软件(SublimeText3)

PHP 8.4 带来了多项新功能、安全性改进和性能改进,同时弃用和删除了大量功能。 本指南介绍了如何在 Ubuntu、Debian 或其衍生版本上安装 PHP 8.4 或升级到 PHP 8.4

CakePHP 是 PHP 的开源框架。它的目的是使应用程序的开发、部署和维护变得更加容易。 CakePHP 基于类似 MVC 的架构,功能强大且易于掌握。模型、视图和控制器 gu

Visual Studio Code,也称为 VS Code,是一个免费的源代码编辑器 - 或集成开发环境 (IDE) - 可用于所有主要操作系统。 VS Code 拥有针对多种编程语言的大量扩展,可以轻松编写

本教程演示了如何使用PHP有效地处理XML文档。 XML(可扩展的标记语言)是一种用于人类可读性和机器解析的多功能文本标记语言。它通常用于数据存储

CakePHP 是一个开源MVC 框架。它使开发、部署和维护应用程序变得更加容易。 CakePHP 有许多库可以减少大多数常见任务的过载。
