Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

GemDependency#add_load_paths does not get them all (and is not tested)

#362

Some gems like rmagick search for files in bin/. There was a patch recently (71528b1825ce5184b23d09f923cb72f4073ce8ed) that added the lib/ directory to $LOAD_PATH.

I reworked that to include a gem's bin/, as well. Attached, find the patch, test included.

Reported by Andreas Fuchs · June 7th, 2008 @ 12:35 PM

State: duplicate
Milestone: none
Assigned to: Pratik Pratik
Importance: none

Activity

  1. Andreas Fuchs
    Andreas Fuchs

    Argh, this is entirely the wrong fix. The right thing, of course, is to load the Gem specification from the locally installed .specification file and use the require_paths declared therein.

    The patch (against v2.1.0) that I'm attaching does this. (Includes a test case.)

    June 7th, 2008 @ 03:24 PM

  2. Pratik
    Pratik
    • Tag set to bug, gem, patch, railties
    • Assigned user set to Rick

    July 2nd, 2008 @ 01:40 AM

  3. Matt Harvey
    Matt Harvey
    • Title changed from GemDependency fails for gems that search for files in bin/ to GemDependency#add_load_paths does not get them all (and is not tested)
    • Tag changed from bug, gem, patch, railties to bug, gem, patch, railties

    This is a good concept. The test is not actually hitting your change, though. It's not really your fault, since you followed a pattern that was not hitting the lines that you removed anyway. That's because GemDependency.unpacked_paths is always empty in the test cases.

    I came upon this after I had a related problem; hpricot does not load when an unpacked and built version under vendor is the only version present on the system. That failure is due to the fact that its compiled extensions are located in subdirectories of ext rather than in ext itself. It would be nice if such subdirectories were reliably listed in the require_paths of .specfication, but at least in the case of hpricot, we can't count on that.

    My patch was going to conflict with yours, and yours did not apply, so I have integrated the two into a new patch (attached).

    It is probably worth noting that, in the same vein, the .specification for rmagick, at least on my system, does not include bin in the require_paths. I included something to address that as well.

    September 17th, 2008 @ 09:48 PM

  4. Pratik
    Pratik
    • Assigned user changed from Rick to Pratik

    Waiting for Matt Jones' review.

    December 20th, 2008 @ 07:29 PM

  5. Matt Jones
    Matt Jones

    This is now handled via the standard Gem specificiation loader used in #1128. OK to close.

    December 20th, 2008 @ 09:13 PM

  6. Pratik
    Pratik
    • State changed from new to duplicate

    December 20th, 2008 @ 09:39 PM