laravel宅基于Windows 7上共享文件夹丢失错误的主机路径

时间:2014-12-30 15:42:22

标签: laravel vagrant homestead

我正试图在我的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正在发挥作用。我不确定我在这里缺少什么。必须是愚蠢的,但任何帮助都会受到赞赏。

3 个答案:

答案 0 :(得分: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

答案 1 :(得分:2)

缺少本地目录。 只需输入mkdir,然后输入缺少的共享文件夹

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

答案 2 :(得分: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