13

我正在尝试在我的 windows 7 机器上设置 laravel 宅基地。我安装了 vagrant 和 virtualbox。还有 git bash shell。

做过

vagrant box add laravel/homestead
composer global require "laravel/homestead=~2.0"

将 composer vendor bin 添加到环境变量中。因此,现在可以从 shell 访问 homestead 命令

homestead init   

我编辑了我的Homestead.yaml文件,这是配置。

我的 laravel 项目目前位于配置中提到的目录中。即(E://)目录

folders:
    - map: /e/Projects/Code/apache/laravel
      to: /home/vagrant/Projects

sites:
    - map: foober.dev
      to: /home/vagrant/Projects/foober/public

现在每当我这样做时homestead up,我都会收到错误消息

Bringing machine 'default' up with 'virtualbox' provider...
There are errors in the configuration of this machine. Please fix
the following errors and try again:

vm:
* The host path of the shared folder is missing: /e/Projects/Code/apache/laravel

我已经确保它cd /e/Projects/Code/apache/laravel正在工作。我不确定我在这里缺少什么。一定很愚蠢,但任何帮助将不胜感激。

4

3 回答 3

21

错误很简单。它在告诉你

The host path of the shared folder is missing: /e/Projects/Code/apache/laravel

您的共享文件夹丢失。根据你的问题。您正在使用窗口。所以,窗口不应该像

cd /e/Projects/Code/apache/laravel

应该是这样的YourPartitionName:/Yourdirectory

例子:

folders:
    - map: E:/Projects/Code/apache/laravel
      to: /home/vagrant/Projects
于 2014-12-30T17:29:27.267 回答
2

本地目录丢失。只需键入 mkdir 后跟缺少的共享文件夹

例如。mkdir /e/Projects/Code/apache/laravel

于 2016-04-28T09:28:31.053 回答
1

示例:在终端中

cd ~/.homestead
subl Homestead.yaml 

---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: /media/Arquivos/www/vagrant/Code
      to: /media/Arquivos/www/vagrant/Code

sites:
    - map: homestead.app
      to: /media/Arquivos/www/vagrant/Laravel

databases:
    - homestead

variables:
    - key: APP_ENV
      value: local

# blackfire:
#     - id: foo
#       token: bar
于 2015-03-31T14:39:14.790 回答