配置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>Copy after loginCopy after login
配置清单:
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>Copy after loginCopy after login
回复内容:
参考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>Copy after loginCopy after login
配置清单:
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>Copy after loginCopy after login
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启动

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

Visual Studio Code, also known as VS Code, is a free source code editor — or integrated development environment (IDE) — available for all major operating systems. With a large collection of extensions for many programming languages, VS Code can be c

This tutorial demonstrates how to efficiently process XML documents using PHP. XML (eXtensible Markup Language) is a versatile text-based markup language designed for both human readability and machine parsing. It's commonly used for data storage an

A string is a sequence of characters, including letters, numbers, and symbols. This tutorial will learn how to calculate the number of vowels in a given string in PHP using different methods. The vowels in English are a, e, i, o, u, and they can be uppercase or lowercase. What is a vowel? Vowels are alphabetic characters that represent a specific pronunciation. There are five vowels in English, including uppercase and lowercase: a, e, i, o, u Example 1 Input: String = "Tutorialspoint" Output: 6 explain The vowels in the string "Tutorialspoint" are u, o, i, a, o, i. There are 6 yuan in total

If you are an experienced PHP developer, you might have the feeling that you’ve been there and done that already.You have developed a significant number of applications, debugged millions of lines of code, and tweaked a bunch of scripts to achieve op

How to implement the table function of custom click to add data in dcatadmin (laravel-admin) When using dcat...

CMS stands for Content Management System. It is a software application or platform that enables users to create, manage, and modify digital content without requiring advanced technical knowledge. CMS allows users to easily create and organize content

Laravel schedule task run unresponsive troubleshooting When using Laravel's schedule task scheduling, many developers will encounter this problem: schedule:run...
