[Rubygems-developers] /etc/gemrc and GEM_PATH behaviour

Chad Woolley thewoolleyman at gmail.com
Mon Sep 1 17:14:59 EDT 2008

On Mon, Sep 1, 2008 at 2:18 AM, Amanda Waite <Amanda.Waite at sun.com> wrote:
> Hi there,
> I've been working on OS level packaging of some Ruby Gems on OpenSolaris. I
> had hoped to be able to use /etc/gemrc to specify the gem search path, but
> I've found that setting gempath in /etc/gemrc only affects the running of
> the gem command and not the running/loading of gems themselves. I've worked
> through the code as best I can and it seems to come down to the GemRunner
> class creating a Gem::ConfigFile instance which then reads the /etc/gemrc
> file. The gempath and gemhome values are then pushed into the Gem.path via
> the use_paths method in rubygems.rb. This code path is only used when
> running the gem command. For running Gems (like rails) or loading gems in
> scripts, the value for default_path is used unless GEM_PATH is set. In this
> case the ConfigFile is never loaded.

Hi Amanda,

There are definitely some bugs in this area.  Sounds like you've
tracked it down further than anyone else, at least anyone who has
posted their findings to the list.  Good job.

If you can open a bug report with a fully reproducible scenario, that
would be a great step forward in fixing the problems.  For example:
exact contents of gemrc, exact steps to reproduce the error (either
via command line or via API in IRB), and detailed description of
expected vs. actual results.

-- Chad

More information about the Rubygems-developers mailing list