[Rubygems-developers] conflict when rubygems generated wrapper tries to load autotest executable on ruby 1.9

lasitha lasitha.ranatunga at gmail.com
Fri Feb 20 15:50:44 EST 2009

Hello All,  while trying out autotest (from ZenTest) on ruby 1.9 i ran
into a load path problem and i'd appreciate some insight on whether
rubygems might help sort it out.

The exception is something like:
/usr/local/ruby1.9/bin/autotest:19:in `load': Is a directory -
        from /usr/local/ruby1.9/bin/autotest:19:in `<main>'

This is a confluence of several disparate factors, but i'll try to
break it down:
* Autotest provides a discovery process that scans for information
contained within directories named 'autotest' on the load path.
* Several gems (e.g. rspec, cucumber, merb) leverage this feature by
providing their own lib/autotest directories.
* Ruby 1.9 starts up with all gem bin/lib directories on the load path.
* The autotest executable is also named 'autotest'.
* So when the rubygems generated wrapper tries to load 'autotest', it
hits one of the autotest directories (from another gem) before it hits
the autotest executable.

The load call then dies with something like:

I can think of several ways to resolve this:
1. ZenTest could rename its executable or its discovery convention.
2. Ruby could ignore directories when it tries to load a file.
3. Rubygems could pass an absolute path to load.

Are there any downsides to #3 ?  By the time the wrapper is ready to
load the executable we've already resolved which version of the gem to
load so it seems like determining the absolute path is only a little
more work.

Are there scenarios other than this one with autotest in which a
similiar conflict might occur?  In other words, is it an edge case
unique to autotest or might we run into other such conflicts?

I'm happy to follow up on options #1 or #2 (or any others) but my
initial guess was they would be harder or take longer to effect than


More information about the Rubygems-developers mailing list