Install gems on Windows 7

Onno's Avatar

Onno

20 Sep, 2010 10:06 AM

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

  1. Support Staff 1 Posted by Nick Quaranto on 25 Sep, 2010 05:13 AM

    Nick Quaranto's Avatar

    Can you paste the output of gem env ?

  2. 2 Posted by Jim Bates on 18 May, 2011 05:49 PM

    Jim Bates's Avatar

    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.

  3. Support Staff 3 Posted by Luis Lavena on 18 May, 2011 06:08 PM

    Luis Lavena's Avatar

    Please, either Jim Bates or Onno, provide the complete output of your gem install command adding --debug -V options to it.

    E.g. If the command was gem install rails then the full command will be gem install rails --debug -V

    Use Pastie.org or gist.github.com to upload the full output and we will be able to help you better.

  4. 4 Posted by Jim Bates on 18 May, 2011 09:10 PM

    Jim Bates's Avatar

    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:

  5. Support Staff 5 Posted by Luis Lavena on 18 May, 2011 11:03 PM

    Luis Lavena's Avatar

    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 HOME SET HOMEDRIVE SET HOMEPATH SET USERPROFILE

    Please add the output to this conversation.

  6. 6 Posted by John on 05 Jun, 2011 09:32 PM

    John's Avatar

    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

  7. Support Staff 7 Posted by Luis Lavena on 06 Jun, 2011 03:27 AM

    Luis Lavena's Avatar

    Hello,

    On your second pastie I see you have some errors in the definition of HOMEPATH

    Since HOME is not set, Ruby is trying to use the combination of HOMEDRIVE and HOMEPATH but the value you have in HOMEPATH seems invalid (echo %HOMEPATH% seems completely invalid)

    Please properly set HOMEPATH to the directory of the H: unit assigned to you and try again.

    Ideally, things should look this way:

    C:\Users\Luis\Projects\oss\ruby>set HOME
    HOMEDRIVE=C:
    HOMEPATH=\Users\Luis
    

    Where C: is in HOMEDRIVE and the path is on HOMEPATH.

    Please adjust that and try again.

  8. 8 Posted by john on 06 Jun, 2011 03:33 AM

    john's Avatar

    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.

  9. Support Staff 9 Posted by Luis Lavena on 06 Jun, 2011 03:41 AM

    Luis Lavena's Avatar

    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.

  10. 10 Posted by Erik Larsson on 11 Oct, 2011 07:43 PM

    Erik Larsson's Avatar

    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

  11. Support Staff 11 Posted by Nick Quaranto on 12 Oct, 2011 02:53 PM

    Nick Quaranto's Avatar

    Is this resolved? Confused as to the current status of this issue...can gems be installed properly on win7?

  12. 12 Posted by Jim Bates on 12 Oct, 2011 03:32 PM

    Jim Bates's Avatar

    I have set the gem up on several windows 7 boxes and I have never been
    able to replicate the issue.

  13. 13 Posted by Erik Larsson on 12 Oct, 2011 03:47 PM

    Erik Larsson's Avatar

    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

  14. 14 Posted by Erik Larsson on 12 Oct, 2011 03:51 PM

    Erik Larsson's Avatar

    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

  15. 15 Posted by Jim Bates on 12 Oct, 2011 05:23 PM

    Jim Bates's Avatar

    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.

  16. Support Staff 16 Posted by Luis Lavena on 12 Oct, 2011 10:10 PM

    Luis Lavena's Avatar

    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.

  17. Luis Lavena closed this discussion on 12 Oct, 2011 10:10 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac