2015-04-12 64 views
0

我試圖讓Laravel運行在運行優勝美地的Imac上的虛擬機上。我已經在我的Macbook上設置了虛擬機,但出於某種原因,我無法讓虛擬機在我的Imac上運行。我相信我所有的目錄路徑都是正確的,但是當我進入虛擬機時,沒有任何一個目錄顯示出來。我相信這是與我的目錄路徑有關,但我讓它們與我的Macbook完全一樣,它似乎仍然無法工作。當我運行「vagrant up」時,我也會得到這兩個錯誤,但是從Ive研究的結果來看,這不應該成爲問題。讓Laravel在imac上的虛擬機上運行

/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 

hosts文件

## 
# 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

'folders: - map:/ Users/username/laravel to:/ home/vagrant/Code' 也許你應該ch憤怒,以你自己的用戶名。 –

+0

@AmarSyla我設置爲我的用戶名,我只是使用用戶名作爲一般的佔位符。 – Tyler

回答

0

你的站點文件夾應指向到/ home /流浪者/代碼/市民不要的/ home /流浪者/代碼/ 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