Kurt StephensNerd Up! | ||
RubyGems : Gem::SourceIndex does not honor GEM_PATH orderingKurt on Wed, 2007-10-17 14:37.
Gem::SourceIndex does not honor GEM_PATH ordering. See: http://rubyforge.org/tracker/index.php?func=detail&aid=14816&group_id=12... Gem::SourceIndex#load_gems_in calls #add_spec for all gems found in #spec_dirs, in the order of Gem.path, however #add_spec
# Add a gem specification to the source index.
def add_spec(gem_spec)
@gems[gem_spec.full_name] = gem_spec
end
Thus: if a gem xyz-1.2.3 exists in multiple gems install directories along Gem.path, the last one found in the Gem.path I think this would fix it:
# Add a gem specification to the source index.
def add_spec(gem_spec, overwrite = false)
@gems[gem_spec.full_name] = nil if overwrite
@gems[gem_spec.full_name] ||= gem_spec
end
If other callers to #add_spec need to overwrite, they could call #add_spec(gem_spec, true) or some variant. This was causing problems with gems that were corrupted further in the Gem.path (e.g.: /usr/lib/ruby by an errant superuser), |
||
Recent comments
5 days 18 hours ago
3 weeks 1 day ago
3 weeks 1 day ago
6 weeks 3 days ago
6 weeks 3 days ago
8 weeks 2 days ago
8 weeks 5 days ago
8 weeks 5 days ago
8 weeks 5 days ago
27 weeks 9 hours ago