This project is archived and is in readonly mode.

rails/init.rb doesn't get called for unpacked gems
Reported by Paul Barry | May 6th, 2008 @ 05:59 AM
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 @ 08:01 AM- 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. 
- 
         Repository May 6th, 2008 @ 08: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 @ 01:32 PMThanks 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 @ 09:00 AMAfter 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 @ 10:11 AMLooks 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 @ 05:40 PM- 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 @ 05:46 PM(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 @ 05:48 PMHey, 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 @ 06:03 PMAwesome I think that will work. Lemme report right back after trying this in production with edge + config.gem. 
- 
            
         
- 
         Pratik May 13th, 2008 @ 06:40 PM- State changed from open to hold
 
- 
            
         Jacek Becela May 28th, 2008 @ 03:10 PMThis is still the case in http://github.com/rails/rails/co... rails/init.rb doesn't get loaded... 
- 
            
         Wincent Colaiuta May 28th, 2008 @ 04:44 PMSee 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. 
- 
            
         Damian Janowski October 17th, 2008 @ 03:48 PM- 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.rbdoes work in frozen gems).
- 
         
- 
            
         
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Referenced by
- 
         59 
          When loading a plugin via rubygems, rake tasks aren't included
        
The problem is it doesn't work yet: #324 and #122. 59 
          When loading a plugin via rubygems, rake tasks aren't included
        
The problem is it doesn't work yet: #324 and #122.
 Bill Burcham
      Bill Burcham
 Cheah Chu Yeow
      Cheah Chu Yeow
 Damian Janowski
      Damian Janowski
 Jacek Becela
      Jacek Becela
 Jacques Crocker
      Jacques Crocker
 Jeremy Kemper
      Jeremy Kemper
 Paul Barry
      Paul Barry
 Pratik
      Pratik
 Repository
      Repository
 Rick
      Rick
 Ryan Bigg
      Ryan Bigg