rails/init.rb doesn't get called for unpacked gems
Reported by Paul Barry | May 5th, 2008 @ 11:59 PM
If you have an unpacked gem that has a rails/init.rb initialization file, it doesn't get called. This patch fixes that.
Comments and changes to this ticket
-
rick May 6th, 2008 @ 02:01 AM
- → Assigned user changed from 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.
-

Repository May 6th, 2008 @ 02:01 AM
- → 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]
-
Paul Barry May 6th, 2008 @ 07:32 AM
Thanks for applying that. I didn't read that bit about submitting a patch instead of forking until after I had already done it.
-
Cheah Chu Yeow May 12th, 2008 @ 03:00 AM
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.
-
-
Cheah Chu Yeow May 13th, 2008 @ 04:11 AM
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.
-
rick May 13th, 2008 @ 11:40 AM
- → 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.
-

Repository May 13th, 2008 @ 11:46 AM
(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]
-
rick May 13th, 2008 @ 11:48 AM
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.
-
Cheah Chu Yeow May 13th, 2008 @ 12:03 PM
Awesome I think that will work. Lemme report right back after trying this in production with edge + config.gem.
-
-
Pratik May 13th, 2008 @ 12:40 PM
- → State changed from open to hold
-
Jacek Becela May 28th, 2008 @ 09:10 AM
This is still the case in http://github.com/rails/rails/co...
rails/init.rb doesn't get loaded...
-

Wincent Colaiuta May 28th, 2008 @ 10:44 AM
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.
Please Login or create a free account to add a new comment.
You can update this ticket by sending an email to from your email client. (help)
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
Source available from github
The Git repository resides at http://github.com/rails
Check out the current development trunk (Edge Rails) with:
git clone git://github.com/rails/rails.git
The latest development for the 1.2.x and 2.0.x releases are on the 1-2-stable and 2-0-stable branches.
Creating a bug report
When creating a bug report, be sure to include as much relevant information as possible. Post the code sample that causes the problem. Preferably, alter the unit tests and show through either changed or added tests how the expected behavior is not occuring.
Security vulnerabilities should be reported via an email to security@rubyonrails.org, do not use trac for reporting security vulnerabilities. All content in trac is publicly available as soon as it is posted.
Then don't get your hopes up. Unless you have a "Code Red, Mission Critical, The World is Coming to an End" kinda bug, you're creating this ticket in the hope that others with the same problem will be able to collaborate with you on solving it. Do not expect that the ticket automatically will see any activity or that others will jump to fix it. Creating a ticket like this is mostly to help yourself start on the path of fixing the problem and for others to sign on to with a "I'm having this problem too".
