vagrant init in Windows bash: Invalid argument - ruby_setenv (Errno::EINVAL)

1,451 views
Skip to first unread message

Dietrich Schulten

unread,
Sep 17, 2015, 12:11:48 PM9/17/15
to Vagrant
Hi,

I try to get started with Vagrant under Windows 7 in Bash. I followed the Getting Started Guide and I try to run my first virtual machine with Virtual Box in bash. 

I've installed Virtual Box and the Virtualbox manager starts up. 
Also, in cmd I can run vagrant init hashicorp/precise32 and vagrant up afterwards (having set up our corporate proxy)

But I get this output in cygwin bash:
$ vagrant init hashicorp/precise32
C:/mystuff/Programme/Vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/bundler.rb:74:in `[]=': Invalid argument - ruby_setenv (Errno::EINVAL)
        from C:/AZ_DATEN/Programme/Vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/bundler.rb:74:in `init!'
        from C:/AZ_DATEN/Programme/Vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/pre-rubygems.rb:23:in `<main>'

The same happens in Windows Git-Bash (Git for Windows 2.5.2-64)

What's amiss? Is it not possible to run vagrant from bash on Windows?

Best regards,
Dietrich





Dietrich Schulten

unread,
Sep 17, 2015, 12:40:26 PM9/17/15
to Vagrant
I should add that I use Vagrant 1.7.4 with VirtualBox 5.0.4.

Alvaro Miranda Aguilera

unread,
Sep 18, 2015, 12:05:58 AM9/18/15
to vagra...@googlegroups.com
maybe it's having other ruby or programs in the path that are causing issues?

What's the output of:

vagrant version
vagrant plugin list

Then from a cmd.exe session
echo %PATH%

From a bash session
echo $PATH
which vagrant
which ruby

Thanks
alvaro.
> --
> This mailing list is governed under the HashiCorp Community Guidelines -
> https://www.hashicorp.com/community-guidelines.html. Behavior in violation
> of those guidelines may result in your removal from this mailing list.
>
> GitHub Issues: https://github.com/mitchellh/vagrant/issues
> IRC: #vagrant on Freenode
> ---
> You received this message because you are subscribed to the Google Groups
> "Vagrant" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to vagrant-up+...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/vagrant-up/3354fa28-d59f-4ade-9798-57018003e881%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Dietrich Schulten

unread,
Sep 19, 2015, 5:13:03 AM9/19/15
to Vagrant
Hi Alvaro,

See the answers to your questions below. Very thorough!

I see no ruby collision, maybe something else collides.

The Git for Windows version I am using is 

$ git --version
git version 2.5.2.windows.1

It has 
$ bash --version
GNU bash, version 4.3.42(2)-release (x86_64-pc-msys)

Am Freitag, 18. September 2015 06:05:58 UTC+2 schrieb Alvaro Miranda Aguilera:
maybe it's having other ruby or programs in the path that are causing issues?

What's the output of:

vagrant version

$ vagrant version                                                                                              
C:/AZ_DATEN/Programme/Vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/bundler.rb:74:in `[]=': Invalid argu
ment - ruby_setenv (Errno::EINVAL)                                                                             
        from C:/AZ_DATEN/Programme/Vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/bundler.rb:74:in `init!
'                                                                                                              
        from C:/AZ_DATEN/Programme/Vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/pre-rubygems.rb:23:in `
<main>'         

 
vagrant plugin list

xs47xsd@CS050342  /c/AZ_DATEN/ws                                                                               
$ vagrant plugin list                                                                                          
C:/AZ_DATEN/Programme/Vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/bundler.rb:74:in `[]=': Invalid argu
ment - ruby_setenv (Errno::EINVAL)                                                                             
        from C:/AZ_DATEN/Programme/Vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/bundler.rb:74:in `init!
'                                                                                                              
        from C:/AZ_DATEN/Programme/Vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/pre-rubygems.rb:23:in `
<main>'                                                                                                         

Then from a cmd.exe session
echo %PATH%

>echo %PATH%
C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\MQClient\Java\lib;C:\
Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\Windows
PowerShell\v1.0\;C:\ProgramData\prisma;C:\Program Files (x86)\prismaclient;C:\Pr
ogram Files (x86)\IBM\Personal Communications\;C:\Program Files (x86)\IBM\Trace
Facility\;C:\Program Files (x86)\Microsoft Application Virtualization Client;C:\
Program Files (x86)\Enterprise Vault\EVClient\;C:\PROGRA~1\IBM\SQLLIB\BIN;C:\PRO
GRA~1\IBM\SQLLIB\FUNCTION;C:\Program Files (x86)\SAS\SharedFiles\Formats;C:\Prog
ram Files (x86)\MQClient\bin64;C:\Program Files (x86)\MQClient\bin;C:\Program Fi
les (x86)\MQClient\Exits;C:\Program Files (x86)\MQClient\ADAG\bin;C:\Program Fil
es (x86)\MQClient\Exits64;C:\Program Files (x86)\MQClient\ADAG\bin64;C:\Program
Files (x86)\UltraEdit;C:\Program Files\TortoiseSVN\bin;C:\az_daten\programme\nod
ejs\;C:\az_daten\programme\Git\cmd;C:\az_daten\programme\Git\mingw64\bin;C:\az_d
aten\programme\Git\usr\bin;C:\AZ_DATEN\Programme\Vagrant\bin;C:\AZ_DATEN\program
me\jdk1.8.0_25\bin;C:\az_daten\npm;C:\AZ_DATEN\programme\maven\apache-maven-3.0.
5\bin

 


From a bash session
echo $PATH

$ echo $PATH
/c/Users/xs47xsd/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/mingw64/bin:/usr/bin:/c/ProgramData/Oracle/Java/javapath:/c/Program Files (x86)/MQClient/Java/lib:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0:/c/ProgramData/prisma:/c/Program Files (x86)/prismaclient:/c/Program Files (x86)/IBM/Personal Communications:/c/Program Files (x86)/IBM/Trace Facility:/c/Program Files (x86)/Microsoft Application Virtualization Client:/c/Program Files (x86)/Enterprise Vault/EVClient:/c/PROGRA~1/IBM/SQLLIB/BIN:/c/PROGRA~1/IBM/SQLLIB/FUNCTION:/c/Program Files (x86)/SAS/SharedFiles/Formats:/c/Program Files (x86)/MQClient/bin64:/c/Program Files (x86)/MQClient/bin:/c/Program Files (x86)/MQClient/Exits:/c/Program Files (x86)/MQClient/ADAG/bin:/c/Program Files (x86)/MQClient/Exits64:/c/Program Files (x86)/MQClient/ADAG/bin64:/c/Program Files (x86)/UltraEdit:/c/Program Files/TortoiseSVN/bin:/c/az_daten/programme/nodejs:/c/az_daten/programme/Git/cmd:/c/az_daten/programme/Git/mingw64/bin:/c/az_daten/programme/Git/usr/bin:/c/AZ_DATEN/Programme/Vagrant/bin:/c/AZ_DATEN/programme/jdk1.8.0_25/bin:/c/az_daten/npm:/c/AZ_DATEN/programme/maven/apache-maven-3.0.5/bin:/usr/bin/vendor_perl:/usr/bin/core_perl



 
which vagrant

$ which vagrant
/c/AZ_DATEN/Programme/Vagrant/bin/vagrant

 
which ruby
                                                                                                                                                                            
$ which ruby
which: no ruby in (/c/Users/xs47xsd/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/mingw64/bin:/usr/bin:/c/ProgramData/Oracle/Java/javapath:/c/Program Files (x86)/MQClient/Java/lib:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0:/c/ProgramData/prisma:/c/Program Files (x86)/prismaclient:/c/Program Files (x86)/IBM/Personal Communications:/c/Program Files (x86)/IBM/Trace Facility:/c/Program Files (x86)/Microsoft Application Virtualization Client:/c/Program Files (x86)/Enterprise Vault/EVClient:/c/PROGRA~1/IBM/SQLLIB/BIN:/c/PROGRA~1/IBM/SQLLIB/FUNCTION:/c/Program Files (x86)/SAS/SharedFiles/Formats:/c/Program Files (x86)/MQClient/bin64:/c/Program Files (x86)/MQClient/bin:/c/Program Files (x86)/MQClient/Exits:/c/Program Files (x86)/MQClient/ADAG/bin:/c/Program Files (x86)/MQClient/Exits64:/c/Program Files (x86)/MQClient/ADAG/bin64:/c/Program Files (x86)/UltraEdit:/c/Program Files/TortoiseSVN/bin:/c/az_daten/programme/nodejs:/c/az_daten/programme/Git/cmd:/c/az_daten/programme/Git/mingw64/bin:/c/az_daten/programme/Git/usr/bin:/c/AZ_DATEN/Programme/Vagrant/bin:/c/AZ_DATEN/programme/jdk1.8.0_25/bin:/c/az_daten/npm:/c/AZ_DATEN/programme/maven/apache-maven-3.0.5/bin:/usr/bin/vendor_perl:/usr/bin/core_perl)

Alvaro Miranda Aguilera

unread,
Sep 20, 2015, 9:53:19 PM9/20/15
to vagra...@googlegroups.com
On Sat, Sep 19, 2015 at 9:13 PM, Dietrich Schulten
<dietrich...@gmail.com> wrote:
> C:/AZ_DATEN/Programme/Vagrant

Hello,

Uhm it's looks good in terms of paths. the only known issue that I am aware are:

- spaces on the path for vagrant. This is a issue with some of the
gems, but you don't have spaces, so all good.
- not rebooting the computer after install

After the installation did you reboot? the installer ask for that
reboot.. a windows thing

If you haven't can you reboot?

If still doesn't work, can you reinstall vagrant, and reboot?

You need to install as your user

Thanks

Akrem Saed

unread,
Feb 15, 2016, 1:25:41 PM2/15/16
to Vagrant
I had the same issue with bash for windows (GNU bash, version 4.3.42(2)-release (x86_64-pc-msys)). The error I saw when I did a vagrant up was: 

Installing plugins: vagrant-proxyconf
C:/bench/tools/Vagrant/embedded/gems/gems/bundler-1.10.6/lib/bundler/shared_helpers.rb:80:in `[]=': Invalid argument - ruby_setenv(PATH) (Errno::EINVAL)
        from C:/bench/tools/Vagrant/embedded/gems/gems/bundler-1.10.6/lib/bundler/shared_helpers.rb:80:in `set_bundle_environment'
        from C:/bench/tools/Vagrant/embedded/gems/gems/bundler-1.10.6/lib/bundler/runtime.rb:222:in `setup_environment'
        from C:/bench/tools/Vagrant/embedded/gems/gems/bundler-1.10.6/lib/bundler/runtime.rb:15:in `setup'
        from C:/bench/tools/Vagrant/embedded/gems/gems/bundler-1.10.6/lib/bundler.rb:129:in `setup'
        from C:/bench/tools/Vagrant/embedded/gems/gems/vagrant-1.8.1/bin/vagrant:71:in `<main>'
Installation of one or more plugins has failed. Aborting.

I got passed that error by using Windows Command Line instead (cmd.exe). And it worked there. So this could be an issue with bash for windows. 
Reply all
Reply to author
Forward
0 new messages