I just installed ruby 1.9.2-p136 using the installer from rubyinstaller.org and now I am trying to install rails. When I do "gem install rails" I get the following error:
C:\Users\Clayton.USA>gem install rails
ERROR: While executing gem ... (Errno::EINVAL)
Invalid argument - P:/
Here are the ruby and gem versions I'm running:
C:\Users\Clayton.USA>ruby -v
ruby 1.9.2p136 (2010-12-25) [i386-mingw32]
C:\Users\Clayton.USA>gem -v
1.3.7
Update: found the solution here: How to stop the 'gem' utility from accessing my home directory?
Added the following to the start of my bin/gem:
ENV['HOME'] = "D:/Ruby192"
In my case running following command from command prompt fixed the homedrive to c: and fixed the gem update issue
SET HOMEDRIVE=c:
your HOMEDRIVE was set to P:, after that command it will be set to C:
you can test by writing only
SET HOMEDRIVE
before and after setting it to C:
You may not want to change your HOMEDRIVE (company laptops are often set with HOMERIVE to a network drive, which may be disconnected at the moment you execute the gem install). I think is not advisable either change the HOMEDRIVE or
stop the 'gem' utility from accessing my home directory
The correct solution to this question is to specify the HOME environment variable which is actually missing in your system. Rubygem always search for it before using the HOMEDRIVE. The simplest solution is then specify the new env variable:
SET HOME %USERPROFILE%
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With