我在我的機器上安裝了vagrant。我在全球和我的項目中都安裝了宅基地。Homestead無法正常工作
當我運行vagrant up
它不起作用,我無法訪問我的瀏覽器中的網址,它出現了一個空白屏幕。
於是我在網上搜索後發現,讓我編輯我的〜/ .bash_profile中,並加入以下代碼使用homestead up
一個解決方案:
function homestead() {
(cd ~/Workspace/homestead && vagrant $*)
}
現在,當我瀏覽到我的項目總監和宅基地跑起來它作品我能夠通過我的瀏覽器中的網址訪問網站,但是我遇到了另一個問題,它似乎是從全球homestead.yaml文件加載而不是我的項目的homestead.yaml文件。
當我從全球homestead.yaml文件中刪除該網站,並把它放在我的項目的homestead.yaml文件我一直沒有得到
輸入文件中指定
這是我的項目的homestead.yaml文件:
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
hostname: blog
name: blog
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: "~/Workspace/blog"
to: "/home/vagrant/workspace/blog"
sites:
- map: blog.app
to: "/home/vagrant/workspace/blog/public"
databases:
- blog
# blackfire:
# - id: foo
# token: bar
# client-id: foo
# client-token: bar
# ports:
# - send: 50000
# to: 5000
# - send: 7777
# to: 777
# protocol: udp
這是我的全球homestead.yaml文件:
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: ~/Workspace
to: /home/vagrant/workspace
sites:
- map: homestead.app
to: /home/vagrant/workspace/Laravel/public
databases:
- blog
# blackfire:
# - id: foo
# token: bar
# client-id: foo
# client-token: bar
# ports:
# - send: 50000
# to: 5000
# - send: 7777
# to: 777
# protocol: udp