0

我试图让 Laravel 在运行 Yosemite 的 Imac 上的虚拟机上运行。我已经在我的 Macbook 上设置了我的 VM,但由于某种原因,我无法让虚拟机在我的 Imac 上运行。我相信我的所有目录路径都是正确的,但是当我 ssh 进入 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
4

1 回答 1

0

您的站点文件夹应该指向 /home/vagrant/Code/public 而不是 /home/vagrant/Code/laravel/public 因为您将 laravel 文件夹映射到 Code 而不是子目录。

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
于 2015-04-13T14:03:47.020 回答