Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 child1
Octocat-spinner-32 child2
Octocat-spinner-32 parent
Octocat-spinner-32 README.textile
Octocat-spinner-32 Rakefile
README.textile

This repo demonstrates a fundamental problem with Ruby 1.9’s strategy of putting the newest version of each gem on the load path.

You can see it in action by running rake test in each of 1.8 and 1.9.

In particular, because gem_prelude skips the gem activation step, having a newer version of a dependency of ANY gem will result in the newer version being used.

In this case, the dependency tree is:

rubygems-bug-parent
|- rubygems-bug-child 1.0

rubygems-bug-child 1.0
rubygems-bug-child 1.1

Triggering code:

require "rubygems"
require "rubygems-bug-parent"

In Ruby 1.8, requiring rubygems-bug-parent puts rubygems-bug-child 1.0 on the load path, so when it requires rubygems-bug-child, it gets 1.0.

In Ruby 1.9, rubygems-bug-child version 1.1 is already on the load path (since it’s the most recent version on your system). Since the Rubygems gem activation system is never loaded, require “rubygems-bug-parent” simply requires the rubygems-bug-child which is on the load path.

In my estimation, this demonstrates a fundamental flaw with the strategy of trying to avoid needing Rubygems for common gems. I recommend shipping with Rubygems as a standard library, but needing require “rubygems” (or -rubygems) to pull it in, just like any other standard library.

Something went wrong with that request. Please try again.