Laravel Homestead Windows 7 上共享文件夹的主机路径丢失错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/27708326/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 10:37:07  来源:igfitidea点击:

laravel homestead the host path of shared folder missing error on windows 7

laravelvagranthomestead

提问by Sojan V Jose

I am trying to set up laravel homestead on my windows 7 machine . I installed vagrant and virtualbox. Also the git bash shell.

我正在尝试在我的 Windows 7 机器上设置 laravel homestead。我安装了 vagrant 和 virtualbox。还有 git bash shell。

did

做过

vagrant box add laravel/homestead
composer global require "laravel/homestead=~2.0"

added composer vendor bin to environment variables.So, homestead command is now accessible from shell

将 composer vendor bin 添加到环境变量中。因此,现在可以从 shell 访问 homestead 命令

homestead init   

I had edited my Homestead.yamlfile and this is the configuration .

我编辑了我的Homestead.yaml文件,这是配置。

I have my laravel projects currently in the mentioned directory in the configuration . ie ( E:// ) directory

我的 Laravel 项目目前位于配置中提到的目录中。即( E:// )目录

folders:
    - map: /e/Projects/Code/apache/laravel
      to: /home/vagrant/Projects

sites:
    - map: foober.dev
      to: /home/vagrant/Projects/foober/public

now whenever I do homestead up, I am getting the error

现在每当我这样做时homestead up,我都会收到错误消息

Bringing machine 'default' up with 'virtualbox' provider...
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: /e/Projects/Code/apache/laravel

I have made sure that cd /e/Projects/Code/apache/laravelis working .I am not sure what I am missing here.Must be something silly, but any help would be appreciated.

我已经确定这cd /e/Projects/Code/apache/laravel是有效的。我不确定我在这里遗漏了什么。一定是愚蠢的,但任何帮助将不胜感激。

回答by Set Kyar Wa Lar

The error is simple. It's telling you

错误很简单。它告诉你

The host path of the shared folder is missing: /e/Projects/Code/apache/laravel

Your shared folder is missing. According to your question. You are using window. So, window shouldn't work like

您的共享文件夹丢失。根据你的问题。您正在使用窗口。所以,窗口不应该像

cd /e/Projects/Code/apache/laravel

Should be like YourPartitionName:/Yourdirectory.

应该像YourPartitionName:/Yourdirectory

Example:

例子:

folders:
    - map: E:/Projects/Code/apache/laravel
      to: /home/vagrant/Projects

回答by Stephen O'Reilly

The local directory is missing. Just type mkdir followed by the missing shared folder

本地目录丢失。只需键入 mkdir 后跟丢失的共享文件夹

eg. mkdir /e/Projects/Code/apache/laravel

例如。 mkdir /e/Projects/Code/apache/laravel

回答by gilcierweb

Exemple: in terminal

例子:在终端

cd ~/.homestead
subl Homestead.yaml 

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

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: /media/Arquivos/www/vagrant/Code
      to: /media/Arquivos/www/vagrant/Code

sites:
    - map: homestead.app
      to: /media/Arquivos/www/vagrant/Laravel

databases:
    - homestead

variables:
    - key: APP_ENV
      value: local

# blackfire:
#     - id: foo
#       token: bar