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.

Generators don't load gems from environment.rb

#1757

When using script/generate, the gem settings in environment.rb are not followed.

So for instance, even if version 0.4.0 of a gem is specified in environment.rb, if a higher version is installed, script/generate will end up using it.

Addressing this is going to be painful... we probably don't want to run the whole Initializer block just to pick up these settings. The solution is probably going be part of #1721 Unify approach to gem dependencies.

Reported by Matt Jones · January 14th, 2009 @ 06:11 AM

State: resolved
Milestone: 3.0.2
Assigned to: José Valim José Valim
Importance: Low

Activity

  1. Matt Jones
    Matt Jones
    • Tag changed from 2.2-stable, bug, gems, generators to 2-3-stable, 2.2-stable, bug, gems, generators
    • Assigned user changed from Matt Jones to Pratik

    Attached is a partial solution to this which at least allows generators in frozen gems to be found and used. It adds the VendorGemSourceIndex stuff and searches the specs correctly. The net effect is that generators inside frozen gems will always have priority.

    Again, not complete (it still doesn't handle a specification of a different system-repository gem) but at least a start.

    No tests, as I couldn't figure out an orderly way to test the interaction between a frozen gem and a system-installed gem. That, and there were exactly 0 tests for the existing "load generators from gems" functionality. Suggestions are welcome.

    Patch is against 2-3-stable.

    May 31st, 2009 @ 03:48 AM

  2. José Valim
    José Valim
    • Assigned user changed from Pratik to José Valim

    Matt, on Rails 3 we are only going to load generators from loaded gems. We hope to offer a more robust solution together with Carlhuda bundler.

    August 10th, 2009 @ 12:15 PM

  3. José Valim
    José Valim
    • State changed from new to resolved

    This is fixed on Rails 3.

    January 2nd, 2010 @ 11:29 PM

  4. Jeremy Kemper
    Jeremy Kemper
    • Milestone set to 3.0.2
    • Importance changed from to Low

    October 15th, 2010 @ 11:01 PM