我试图让Laravel在运行优胜美地的Imac上的虚拟机上运行。我已经在我的Macbook上设置了我的虚拟机,但由于某种原因,我无法让虚拟机在我的Imac上工作。我相信我的所有目录路径都是正确的,但是当我进入VM时,我的目录都没有显示出来。我相信它与我的目录路径有关,但是我的路由与我在Macbook上完全一样,但它似乎仍然无法正常工作。当我跑步时,我也会得到这两个错误" vagrant up"但是从我研究过的那些不应该成为问题。
/opt/vagrant/bin/../embedded/gems/gems/vagrant-1.7.2/lib/vagrant/pre-rubygems.rb:31:
warning: Insecure world writable dir /Users/tylerfoulkes in PATH, mode 040777
/opt/vagrant/embedded/gems/gems/bundler-1.7.11/lib/bundler/runtime.rb:222: warning: Insecure world writable dir
/Users/tylerfoulkes in PATH, mode 040777
Homestead.yaml文件
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: /Users/username/laravel
to: /home/vagrant/Code
sites:
- map: learn.app
to: /home/vagrant/Code/laravel/public
databases:
- homestead
variables:
- key: APP_ENV
value: local
# blackfire:
# - id: foo
# token: bar
主持文件
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
127.0.0.1 learn.app
答案 0 :(得分:0)
您的站点文件夹应指向/ home / vagrant / Code / public not / home / vagrant / Code / laravel / public,因为您将laravel文件夹映射到Code not in子目录。
folders:
- map: /Users/username/laravel
to: /home/vagrant/Code
sites:
- map: learn.app
to: /home/vagrant/Code/public
或者如果你想在子目录中使用laravel
folders:
- map: /Users/username/laravel
to: /home/vagrant/Code/laravel
sites:
- map: learn.app
to: /home/vagrant/Code/laravel/public
除非laravel目录包含一堆不同的laravel项目,否则它看起来更像......
folders:
- map: /Users/username/laravel
to: /home/vagrant/Code
sites:
- map: project.app
to: /home/vagrant/Code/project/public
- map: project2.app
to: /home/vagrant/Code/project2/public