Set gem paths on Win7

I'm new th RM.

How can I prevent RubyMine from using the %HOMEDRIVE% and %HOMEPATH% set in my environment?  Its creating a .gem folder on a network drive that isn't always attached.  I would like to specify where RubyMine should create this folder.

0

While configuring SDK RubyMine gets gem paths from "gem environment paths" command output. Setup your environment to force gem command to return correct paths and recreate SDK in RubyMine | File | Settings | Ruby SDK and Gems Manager | Add SDK

0

Thanks for the reply.

I realize that this my be out of scope for this forum but can you point me to how I might "force" the gem command to return the correct paths?

In the windows environment there is a gem.bat file.  I've modified that to set the %HOMEDRIVE% and %HOMEPATH% to the location I want prior to executing.

 @ECHO OFF
SET _HOMEDRIVE=%HOMEDRIVE%
SET _HOMEPATH=%HOMEPATH%
SET HOMEDRIVE=C:
SET HOMEPATH=/Users/cl
IF NOT "%~f0" == "~f0" GOTO :WinNT
@"ruby.exe" "C:/Ruby187/bin/gem" %1 %2 %3 %4 %5 %6 %7 %8 %9
GOTO :EOF
:WinNT
@"ruby.exe" "%~dpn0" %*
SET HOMEDRIVE=%_HOMEDRIVE%
SET HOMEPATH=%_HOMEPATH%


If I issue a 'gem env' from the command prompt I get the proper location

GEM PATHS:
  C:/Ruby187/lib/ruby/gems/1.8
  C:/Users/cl/.gem/ruby/1.8


However, when I start RubyMine and choose Tools | Get Gem Environment it still uses the wrong location.

 GEM PATHS:
    C:/Ruby187/lib/ruby/gems/1.8
    H:/.gem/ruby/1.8


Does RubyMine execute gem in some other fashion other than the gem.bat file?

Any help would be greately appreciated!
0

RubyMine launches "ruby.exe gem ..." instead of "gem.bat".
Are GEM_HOME and GEM_PATH env variables defined in your windows env variables settings?

0

They were not set but they are now.  Thats what I needed to set to change the gem paths.

Thanks for your help!

0

请先登录再写评论。