[Rubygems-developers] Bugs with ~/.gemrc gemhome and gempath overrides not being respected

Phil Hagelberg technomancy at gmail.com
Fri Oct 3 13:25:14 EDT 2008

"Chad Woolley" <thewoolleyman at gmail.com> writes:

> First, there is some confusion over whether the 'gempath' and
> 'gemhome' keys should be strings or symbols.  Looking through
> config_file.rb and environment_command.rb, there are inconsistencies.
> You will also get different results from Gem.path and `gem env`
> depending on whether you use strings or symbols

It's my understanding they should always be symbols, but I could be
wrong here. I looked through environment_command.rb, and I don't see any
reference to string versions; could you point them out?

> Next, there are problems on Leopard where the overrides in .gemrc will
> be overridden (if APPLE_GEM_HOME or RUBY_FRAMEWORK_VERSION exist).
> The settings in .gemrc should always take precedence, I would think.

I can't speak for Mac users and the motivations behind those overrides,
but it does look like Gem.dir gets added to the path whether you want it
or not (Gem.set_paths in lib/rubygems.rb; currently at line 704). I'm
not sure why this is the case; should it be removed?

I did also notice that Gem.dir does not respect the values in ~/.gemrc,
so I've made it use :gemhome from the config file if present. This seems
to be the right thing to do since it also checks ENV['GEM_HOME']. With
this addition, you should be able to ignore system-level gems using only
the config file modulo problems with Apple's installation.


More information about the Rubygems-developers mailing list