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.

rails/init.rb doesn't get called for unpacked gems

#122

If you have an unpacked gem that has a rails/init.rb initialization file, it doesn't get called. This patch fixes that.

http://github.com/pjb3/rails/com...

Reported by Paul Barry · May 6th, 2008 @ 05:59 AM

State: hold
Milestone: none
Assigned to: Rick Rick
Importance: none

Activity

  1. Rick
    Rick
    • Assigned user set to Rick

    Hey, I just pushed this to my rails fork, but I didn't merge the commit right. Sorry about that.

    Also it's not necessary to create a fork for minor patches like this. It's sufficient to use git format-patch as the rails patch docs suggest.

    May 6th, 2008 @ 08:01 AM

  2. Repository
    Repository
    • State changed from new to resolved

    (from [123e55686de920499cc8572f3a8b4d585d20ab02]) Fix bug where plugin init.rb files from frozen gem specs weren't being run. (pjb3) [#122 state:resolved]

    http://github.com/rails/rails/co...

    May 6th, 2008 @ 08:01 AM

  3. Paul Barry
    Paul Barry

    Thanks for applying that. I didn't read that bit about submitting a patch instead of forking until after I had already done it.

    May 6th, 2008 @ 01:32 PM

  4. Cheah Chu Yeow
    Cheah Chu Yeow

    After this patch (see http://github.com/rails/rails/co...), I'm noticing that the Gem Locator will not be able to find a gem specification for unpacked gems in vendor/gems (it's nil when initializer.configuration.gems.map(&:specification) is called).

    This is causing my rake tasks (it's an Ultrasphinx rake task one FWIW) to fail because the gem specs list now contains nil entries.

    Plus I think there's a bug here (yes untested, but looked like a likely error anyway):

    specs + Gem.loaded_specs.values.select do |spec|
    

    It should be += I think.

    May 12th, 2008 @ 09:00 AM

  5. Matt Lyon
    Matt Lyon

    ditto Cheah Chu Yeow's statement.

    May 13th, 2008 @ 02:35 PM

  6. Cheah Chu Yeow
    Cheah Chu Yeow

    Looks like Mark Lyon's comment is being marked as spam incorrectly.

    Anyway, sorry about not having a patch, but I suggest we revert this commit [http://github.com/rails/rails/co...] at the very least prior to 2.1 and re-opening this ticket.

    May 13th, 2008 @ 10:11 AM

  7. Rick
    Rick
    • State changed from resolved to open

    I just checked w/ matt, he's seeing a completely different issue that no one else can replicate.

    Cheah: I'm going to add your suggested fix to my Rails fork and see how that works out.

    May 13th, 2008 @ 05:40 PM

  8. Repository
    Repository

    (from [92e2e5990cc2aa4f699c286ac5d1f73e27ede548]) include bugfix to [e792d4ab70448f79142fdf492390682ff5ea6398] for rubygems 1.0.1. Gem::DependencyList#dependency_order was bombing with nil specs passed in from a frozen gem. [#122]

    http://github.com/rails/rails/co...

    May 13th, 2008 @ 05:46 PM

  9. Rick
    Rick

    Hey, I had that fix already in my rails fork, but I hadn't merged it:

    http://github.com/rails/rails/co...

    It's merged now, let me know how it works.

    May 13th, 2008 @ 05:48 PM

  10. Cheah Chu Yeow
    Cheah Chu Yeow

    Awesome I think that will work. Lemme report right back after trying this in production with edge + config.gem.

    May 13th, 2008 @ 06:03 PM

  11. Cheah Chu Yeow
    Cheah Chu Yeow

    Yup the issue I reported has gone away. Thanks Rick!

    May 13th, 2008 @ 06:08 PM

  12. Pratik
    Pratik
    • State changed from open to hold

    May 13th, 2008 @ 06:40 PM

  13. Jacek Becela
    Jacek Becela

    This is still the case in http://github.com/rails/rails/co...

    rails/init.rb doesn't get loaded...

    May 28th, 2008 @ 03:10 PM

  14. Wincent Colaiuta
    Wincent Colaiuta

    See also ticket #268. I ran into one of the problems mentioned here (the bombing out on nil) and attached a patch that fixes it. But looks like the equivalent fix has already been applied to the master branch here:

    http://github.com/rails/rails/co...

    But there are still a couple of issues to be resolved prior to 2.1 final. See ticket #268 for details.

    May 28th, 2008 @ 04:44 PM

  15. Damian Janowski
    Damian Janowski
    • Tag set to dependencies, edge, patch, railties

    Has somebody been following up on this?

    I believe it's not working for me in 2.1.1 (however /init.rb does work in frozen gems).

    October 17th, 2008 @ 03:48 PM

  16. Ryan Bigg
    Ryan Bigg
    • Tag cleared.

    Automatic cleanup of spam.

    October 9th, 2010 @ 09:49 PM

  17. bingbing