Install gems on Windows 7
Hi,
I'm trying to install a gem in a location of my preference. Defaults Rubygems seems determined to install on my user network drive, which I don't want.
I played around with GEM_HOME thinking this might be a way to specifiy a non-default location for my gems. I tried set GEM_HOME=D:/gems and set GEM_HOME=D:/gems/lib/ruby/gems/1.8. This variable does seem to do much. Gem install will always install in my user network drive.
I'm trying to do this on Windows 7 using Ruby 1.8.6 and Rubygems 1.3.7.
Thanks and Regards,
Onno
Comments are currently closed for this discussion. You can start a new one.
Support Staff 2 Posted by Nick Quaranto on 25 Sep, 2010 05:13 AM
Can you paste the output of
gem env?3 Posted by Jim Bates on 18 May, 2011 05:49 PM
I have the same problem with Ruby 1.9.2 and Ruby 1.9.1.
I have even uninstalled Ruby, removed the network drive, and then installed after with no luck.
Also, gems keeps giving me an error where they specify there is no space left on the network drive but several gigs of space is available.
Support Staff 4 Posted by Luis Lavena on 18 May, 2011 06:08 PM
Please, either Jim Bates or Onno, provide the complete output of your gem install command adding
--debug -Voptions to it.E.g. If the command was
gem install railsthen the full command will begem install rails --debug -VUse Pastie.org or gist.github.com to upload the full output and we will be able to help you better.
5 Posted by Jim Bates on 18 May, 2011 09:10 PM
Exception `NameError' at
C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/command_ma
nager.rb:163 - uninitialized constant Gem::Commands::InstallCommand
Exception `Errno::ENOENT' at
C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/spec_f
etcher.rb:54 - No such file or directory - H:/
ERROR: While executing gem ... (Errno::ENOENT)
No such file or directory - H:/
C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/spec_fetcher.rb:54:in
`stat
'
C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/spec_fetcher.rb:54:in
`init
ialize'
C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/spec_fetcher.rb:43:in
`new'
C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/spec_fetcher.rb:43:in
`fetc
her'
C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/dependency_installer.rb:108
:in `find_gems_with_sources'
C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/dependency_installer.rb:212
:in `find_spec_by_name_and_version'
C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/dependency_installer.rb:244
:in `install'
C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/commands/install_command.rb
:120:in `block in execute'
C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/commands/install_command.rb
:115:in `each'
C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/commands/install_command.rb
:115:in `execute'
C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/command.rb:278:in
`invoke'
C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/command_manager.rb:133:in `
process_args'
C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/command_manager.rb:103:in `
run'
C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/gem_runner.rb:63:in
`run'
C:/Ruby192/bin/gem:21:in `<main>'
On 5/18/11 1:08 PM, "Luis Lavena"
<[email blocked]> wrote:
Support Staff 6 Posted by Luis Lavena on 18 May, 2011 11:03 PM
Thank you, was hoping you put this in a pastie anyhow.
H:/seems to be a network drive.Can you confirm the value of the following environment variables?
SET HOMESET HOMEDRIVESET HOMEPATHSET USERPROFILEPlease add the output to this conversation.
7 Posted by John on 05 Jun, 2011 09:32 PM
I am getting the same error message.
Here is my debug text.
http://pastie.org/2024367
And here are the values you ask for. In my case, H:/ is definitely a network drive.
http://pastie.org/2024356
Support Staff 8 Posted by Luis Lavena on 06 Jun, 2011 03:27 AM
Hello,
On your second pastie I see you have some errors in the definition of
HOMEPATHSince
HOMEis not set, Ruby is trying to use the combination ofHOMEDRIVEandHOMEPATHbut the value you have inHOMEPATHseems invalid (echo %HOMEPATH%seems completely invalid)Please properly set
HOMEPATHto the directory of theH:unit assigned to you and try again.Ideally, things should look this way:
Where
C:is in HOMEDRIVE and the path is on HOMEPATH.Please adjust that and try again.
9 Posted by john on 06 Jun, 2011 03:33 AM
Thanks for the response!
I saw a couple of sites that suggested renaming or deleting the following directory:
c:\ruby192\lib\ruby\site_ruby
I renamed it, and reinstalled. Everything worked great.
Support Staff 10 Posted by Luis Lavena on 06 Jun, 2011 03:41 AM
Dunno what renaming that directory has nothing to do with gem installation unless your installation wasn't clear. Would love to know were you read that...
Anyhow, it is clear that your environment variables are not properly set and beyond that directory I forsee issues in the future if these variables are not corrected.
11 Posted by Erik Larsson on 11 Oct, 2011 07:43 PM
FYI: It is not uncommon in company environments to map HOME to a network drive (e.g. H: is mapped to \server\home\user). At least on my computer (Windows 7) that network drive is not available from the command line (e.g. I can access H: using Windows explorer, but I cannot user the H drive from the command line).
In my case I could execute "SET HOME=%USERPROFILE%" and after that it seems to work
Support Staff 12 Posted by Nick Quaranto on 12 Oct, 2011 02:53 PM
Is this resolved? Confused as to the current status of this issue...can gems be installed properly on win7?
13 Posted by Jim Bates on 12 Oct, 2011 03:32 PM
I have set the gem up on several windows 7 boxes and I have never been
able to replicate the issue.
14 Posted by Erik Larsson on 12 Oct, 2011 03:47 PM
Hi nick.
I found the post using google, and thought to add my resolution for others. You should not consider my addition as a reopening of an old issue.
Kind regards
/ Erik
15 Posted by Erik Larsson on 12 Oct, 2011 03:51 PM
Hi jim. The issue is resolved for me. If youd like, i could supply my configuration details (mapped network drive in offline mode) and process (railsinstaller) for your knowledgebase?
/ Erik
16 Posted by Jim Bates on 12 Oct, 2011 05:23 PM
That would be great! I have added the support and knowledge base manager
to the thread.
Emil, Mark, and Eric. I'll follow up to you with the details behind this
one.
Support Staff 17 Posted by Luis Lavena on 12 Oct, 2011 10:10 PM
Would you mind adding this to the RubyInstaller's Troubleshooting wiki page?
https://github.com/oneclick/rubyinstaller/wiki/Troubleshooting
Closing this now since the issue seems to be solved.
Luis Lavena closed this discussion on 12 Oct, 2011 10:10 PM.