Laravel homestead not mapping my code folder

独自空忆成欢 提交于 2019-12-22 05:08:12

问题


I am trying to get homestead to work after following the instructions here

I have Virtualbox 5.0.6 and Vagrant 1.7.4 on windows 8. The machine boots up fine(ish) the only problem is that my mapped folder is not present on the vm, meaning when I vagrant ssh, the directory /home/vagrant/ is empty, there is no Code directory inside of it. This is a screenshot of the machine booting(it should keep going and saying mapping the folders and stuff):

And this is the content of my Homestead.yaml file

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

authorize: C:\Users\Khalid\.ssh\id_rsa.pub

keys:
    - C:\Users\Khalid\.ssh\id_rsa

folders:
    - map: D:\work
      to: /home/vagrant/Code

sites:
    - map: homestead.app
      to: /home/vagrant/Code/Laravel/public

databases:
    - homestead

variables:
    - key: APP_ENV
      value: local

# blackfire:
#     - id: foo
#       token: bar
#       client-id: foo
#       client-token: bar

# ports:
#     - send: 93000
#       to: 9300
#     - send: 7777
#       to: 777
#       protocol: udp

Could someone please help, Thanks

EDIT: The full output of vagrant up --debug can be found here


回答1:


sstarlight was on the right track. It's a path name issue. I'm on windows 8 with homestead too and you need to use the forward slashes even in your windows paths.

The below should do the trick!

authorize: C:/Users/Khalid/.ssh/id_rsa.pub

keys:
    - C:/Users/Khalid/.ssh/id_rsa

folders:
    - map: D:/work
      to: /home/vagrant/Code

sites:
    - map: homestead.app
      to: /home/vagrant/Code/Laravel/public

I would add to this that you should run the provisioning as per the other answer after you make the change by bringing your homestead up with the --provision flag set.




回答2:


Make sure and re-verify that the path for the keys and authorize are correct and run vagrant up --provision to re-provision the homestead setup again




回答3:


Try change

 D:\work to D:/work/


来源:https://stackoverflow.com/questions/33113442/laravel-homestead-not-mapping-my-code-folder

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