在 iMac 上的虚拟机上获取 Laravel 运行
getting Laravel running on a VM on imac
我正在尝试在我的 Imac 运行ning Yosemite 上的虚拟机上获取 Laravel 运行ning。我已经在我的 Macbook 上设置了我的虚拟机,但由于某种原因,我无法让虚拟机在我的 Imac 上运行。我相信我的所有目录路径都是正确的,但是当我通过 ssh 进入 VM 时,我的目录 none 出现了。我相信这与我的目录路径有关,但我的路径与我在 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
您的站点文件夹应指向 /home/vagrant/Code/public 而不是 /home/vagrant/Code/laravel/public,因为您将 laravel 文件夹映射到代码而不是子目录。
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
我正在尝试在我的 Imac 运行ning Yosemite 上的虚拟机上获取 Laravel 运行ning。我已经在我的 Macbook 上设置了我的虚拟机,但由于某种原因,我无法让虚拟机在我的 Imac 上运行。我相信我的所有目录路径都是正确的,但是当我通过 ssh 进入 VM 时,我的目录 none 出现了。我相信这与我的目录路径有关,但我的路径与我在 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
您的站点文件夹应指向 /home/vagrant/Code/public 而不是 /home/vagrant/Code/laravel/public,因为您将 laravel 文件夹映射到代码而不是子目录。
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