laravel homestead the host path of shared folder missing error on windows 7

∥☆過路亽.° 提交于 2019-12-03 17:30:30

问题


I am trying to set up laravel homestead on my windows 7 machine . I installed vagrant and virtualbox. Also the git bash shell.

did

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

added composer vendor bin to environment variables.So, homestead command is now accessible from shell

homestead init   

I had edited my Homestead.yaml file and this is the configuration .

I have my laravel projects currently in the mentioned directory in the configuration . ie ( E:// ) directory

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

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

now whenever I do homestead up, I am getting the error

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

I have made sure that cd /e/Projects/Code/apache/laravel is working .I am not sure what I am missing here.Must be something silly, but any help would be appreciated.


回答1:


The error is simple. It's telling you

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

Your shared folder is missing. According to your question. You are using window. So, window shouldn't work like

cd /e/Projects/Code/apache/laravel

Should be like YourPartitionName:/Yourdirectory.

Example:

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



回答2:


The local directory is missing. Just type mkdir followed by the missing shared folder

eg. mkdir /e/Projects/Code/apache/laravel




回答3:


Exemple: in terminal

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


来源:https://stackoverflow.com/questions/27708326/laravel-homestead-the-host-path-of-shared-folder-missing-error-on-windows-7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!