无法在Windows 8.1中的Vagrant中安装插件hostmanager [英] Unable to install plugin hostmanager in vagrant in windows 8.1
问题描述
无法安装插件,显示以下错误...
Not able to install plugin its showing the below error...
C:\ devbox> vagrant插件安装'vagrant-hostmanager' 安装插件的目录(Vagrant主目录) 有一个空间.在Windows上,编译时Ruby中有一个错误 插入带有空格的目录中.请把你的流浪汉搬回家 目录中没有空格的路径,然后重试.
C:\devbox>vagrant plugin install 'vagrant-hostmanager' The directory where plugins are installed (the Vagrant home directory) has a space in it. On Windows, there is a bug in Ruby when compiling plugins into directories with spaces. Please move your Vagrant home directory to a path without spaces and try again.
推荐答案
Ruby(Vagrant使用的语言)具有目录名称包含空格的问题".
Ruby (language used by Vagrant) has "issues" with directory names that contain spaces.
Vagrant将使用一个环境变量(由Windows提供)来告诉它您的用户目录在哪里(以便它可以决定将主"目录放在何处). 但是您的用户名中可能有一个空格(我确实有),这会导致ruby出现问题(正在做安装插件的工作).
Vagrant will use an environment variable (supplied by windows) to tell it where your user directory is (so it can decide where to put your "home" directory). But you might have a space in your user name (I do) which causes a problem for ruby (which is doing the work to install the plugin).
解决方案是将您的项目移动到您选择的项目目录中,该目录在目录名称中没有任何空格.然后,使用名为VAGRANT_HOME
的环境变量并将其设置为指定的目录.插件安装过程将检查此变量是否存在,并使用该变量(如果存在),而不是在Windows当前用户目录中定位主目录.
The solution is to move your project to a project directory you choose that doesn't have any spaces in the directory name. Then, use an environment variable called VAGRANT_HOME
and set it to a specified directory. The plugin installation procedure will check for the existence of this variable and use it if it exists instead of locating a home directory within the windows current user directory.
我在C:\Hashicorp\Vagrant
中创建了一个名为home
的文件夹,并使用了该文件夹(C:\Hashicorp\Vagrant\home
).
I created a folder called home
within C:\Hashicorp\Vagrant
and used that (C:\Hashicorp\Vagrant\home
).
设置Windows环境变量并不难(实际上比较琐碎)-您可以在这里找到方法: http://www.computerhope.com/issues/ch000549.htm
Setting windows environment variables is not hard (rather trivial actually) - you can find out how here: http://www.computerhope.com/issues/ch000549.htm
您必须重新启动系统才能使它生效(对我而言,所有操作在重新启动后都有效).
You'll have to do a restart to your system for it to take effect (it all worked after a reboot for me).
这篇关于无法在Windows 8.1中的Vagrant中安装插件hostmanager的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!