Could not install hostmanager plugin in Windows 8.1

Failed to install the plugin with the error below ...

C: \ devbox> vagrant plugin install 'vagrant-hostmanager' The directory in which the plugins are installed (the Vagrant home directory) takes place in it. On Windows in Ruby, there is an error compiling plugins into directories with spaces. Please move your homeless home to the directory without spaces and try again.

+6
source share
2 answers

Ruby (the language used by Vagrant) has "problems" with directory names that contain spaces.

Vagrant will use an environment variable (provided by Windows) to tell it where your user directory is located (so it can decide where to place its "home" directory). But you may have a space in the username (I do), which causes a problem for ruby ​​(which does the job of installing the plugin).

The solution is to move your project to the directory of the project that you selected, which does not have spaces in the directory name. Then use the environment variable named VAGRANT_HOME and set it to the specified directory. The plugin installation procedure checks for the presence of this variable and uses it if it exists, instead of finding the home directory in the directory of the current Windows user.

I created the home folder inside C:\Hashicorp\Vagrant and used it ( C:\Hashicorp\Vagrant\home ).

Setting Windows environment variables is not complicated (rather trivial) - you can find out how here: http://www.computerhope.com/issues/ch000549.htm

You will need to reboot the system for it to take effect (it all worked after rebooting for me).

+17
source

I found a slight deviation from @Reinsbrains answer. To have a home directory without spaces in its name. I created a connection to my user / home directory. In my case, I decided to go with a Linux style framework, but any place would work. In the admin command line:

 mkdir c:\home mklink /jc:\home\maarten "c:\users\Maarten Bicknese" 

Then set the VAGRANT_HOME environment VAGRANT_HOME for the newly created connection.

 setx VAGRANT_HOME c:\home\maarten 

Launch a new command line and you will be fine!

+15
source

Source: https://habr.com/ru/post/976008/


All Articles