Laravel Homestead - vm:The 缺少共享文件夹的主机路径:~/OSX Yosemite 上的代码

Laravel Homestead - vm:The host path of the shared folder is missing: ~/Code on OSX Yosemite

我全新安装了 laravel Homestead,我的 Homestead.yaml 看起来像这样:

ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: /srv/my_app
      to: /home/vagrant/Code

sites:
    - map: homestead.app
      to: /home/vagrant/Code/public

databases:
    - homestead

当我尝试 vagrant up 时:我得到这个错误:

There are errors in the configuration of this machine. Please fix
the following errors and try again:

vm:
* The host path of the shared folder is missing: ~/Code

~/Code 不存在,但它被指定为 yaml 文件中的其他路径,似乎 vagrant 将它保存在内存中的某处,知道吗?

万一当我创建 ~/Code 目录时它可以工作 vagrant 已启动但代码不存在,因为它位于其他位置并且映射根本不起作用,我 运行 进入 "No input file specified" 问题很明显。

您可能编辑了错误的文件。

在 运行 初始化 homestead 之后,会在您的主目录下创建一个本地配置文件:

~/.homestead/Homestead.yaml 您需要在那里应用更改才能生效。