[Rubygems-developers] Best practices for managing GEM_PATH, GEM_HOME, and related stuff?

Eric Hodel drbrain at segment7.net
Tue Feb 26 22:00:46 EST 2008

On Feb 26, 2008, at 18:24 PM, Donavan Pantke wrote:
> On Tuesday 26 February 2008 08:07:33 pm Eric Hodel wrote:
>> On Feb 26, 2008, at 10:27 AM, Chad Woolley wrote:
>>> Scenario 1: Existing rubygems install, with some gems installed in  
>>> the
>>> default system location.  I want to programatically (such as
>>> Gem::GemRunner) install some additional gems in a user-writeable
>>> location (~/gems).  After additional gems are installed, they should
>>> all (system and user-writable) be loadable with the 'gem' method
>>> and/or require.
>> According to the documentation of your shell,
>> set GEM_PATH to `gem env gempath` with ~/gems added
>> set GEM_HOME to ~/gems
>> At this point, `gem install` will install gems into ~/gems.
> Should we expose set_home and set_path? That way someone could  
> override the
> current home and path according to what the caller wants.

Probably, there needs to be some refactoring though, as Gem::path adds  
things to the path in case of APPLE_GEM_HOME.

More information about the Rubygems-developers mailing list