Gems home drive point to network drive, not my local

vlado's Avatar


17 Dec, 2013 03:57 PM

Hello everyone,
I have tricky situation where when I try to install a gem - it tries to write on my H: drive, which is network drive and it is extremely slow.
I've met the very same description of the problem here, but unfortunately it doesn't solve my issue. From the previous post I've read this at github and specially the part with the network drive. I've dome everything described there and this time the message after I' set the #SET HOME=%USERPROFILE%# things are changed and it comes with error "_permission denied_" in my home directory d:\users\username.gem.

Basically what I have is:
puts File.expand_path '~' => H: puts Gem.user_home => H:

- RUBY VERSION: 2.0.0 (2013-11-22 patchlevel 353) [x64-mingw32]
- INSTALLATION DIRECTORY: C:/Ruby200-x64/lib/ruby/gems/2.0.0
- RUBY EXECUTABLE: C:/Ruby200-x64/bin/ruby.exe
- EXECUTABLE DIRECTORY: C:/Ruby200-x64/bin
- ruby
- x64-mingw32
- C:/Ruby200-x64/lib/ruby/gems/2.0.0
- H:/.gem/ruby/2.0.0
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000

I want my homedrive and path to point to D:

how this can be done?

I sent a lot of time of reading and trying some workarounds, but without any success.
I'm fighting with this for two days and will be really thankful if anyone here can help me.

  1. 1 Posted by Luis Lavena on 17 Dec, 2013 05:20 PM

    Luis Lavena's Avatar

    Hello vlado,

    If you look at the top: INSTALLATION DIRECTORY indicated where gems will be
    installed, which in your case, will be installed in C: drive.

    If for some reason you can't install there, you can setup GEM_HOME
    environment variable and indicate where you want the gems be installed.

    By default, RubyGems will look for that variable and if not, will default
    to the combination of HOMEDRIVE+HOMEPATH environment variables, which in
    your case seems to point to your network share.

    This might be due a misconfiguration of your network administrator, but you
    can override that by setting the variable I mentioned above.

    Please note that you will have to add to the PATH the "bin" part where you
    set GEM_HOME to. Eg.:

    C:\>mkdir D:\mygems
    C:\>SET GEM_HOME=D:\mygems
    C:\>SET PATH=%PATH%;C:\mygems\bin

    Then, check the output of "gem env" and see that now INSTALLATION DIRECTORY
    points to this location.

    Please note that this will affect any gem that was installed before, as
    GEM_HOME contains the new place to look for gems.

    You will need to use variables like GEM_PATH to be able to load gems
    previously installed.

    Hope that helps.

  2. 2 Posted by vlado on 18 Dec, 2013 12:39 PM

    vlado's Avatar

    I have permission denied message, when I changed my home folder.
    for Example I'm trying this:

    D:\vagrant\magentobox\vagrant>gem install bourbon
    ERROR:  While executing gem ... (Errno::EACCES)
    Permission denied - D:/Users/vvarbanov/.gem/specs/
  3. Support Staff 3 Posted by Nick Quaranto on 16 Apr, 2014 03:56 PM

    Nick Quaranto's Avatar

    Did this ever get resolved? Also, FWIW...StackOverflow might be a better way to seek help for this kind of stuff.

  4. Nick Quaranto closed this discussion on 16 Apr, 2014 03:56 PM.

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

Keyboard shortcuts


? 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