From: Mauricio Fernandez Date: 2006-04-16T07:31:56+09:00 Subject: Re: Bug: Requiring "breakpoint" causes the entire Rails framework to load. On Sun, Apr 16, 2006 at 05:21:41AM +0900, Florian Gro� wrote: > >I'm no gems internals guru but it seems to me that when you require > >'rubygems' all of the gems/**/lib directories are added to the path, and > >the > >rails gem has a lib/breakpoint.rb. When looking at the lib directories of > >most other gems, it looks like the rails gem has a fairly dirty lib/. > > Oh, it still bundles breakpoint? I guess that would be better solved by > adding a dependency on ruby-breakpoint now that it comes with a gem. > > IIRC they were using slightly different default options, but if that > really turns out to be a problem I can certainly try to address this in > a new version of ruby-breakpoint. > > It's also odd that RubyGems will load the Rails version instead of the > ruby-breakpoint one. Sounds odd. This is a simple conflict between the two RubyGems packages; such things are bound to happen with increasing frequency. When you do require 'breakpoint', the new Kernel#require defined by RubyGems searches all package directories (more precisely, the require_paths, which doesn't however help that much given the overall slowness of this approach) for breakpoint{,.rb,.so,.bundle,.dll,.sl} and loads the first match it finds, "activating" the corresponding RubyGems package in the process. This search is performed in alphabetical order relative to package names, so rails' copy (under activesupport/) will be found before ruby-breakpoint. As for require 'breakpoint' loading all of Rails, that's quite surprising since there are no explicit #require calls there, and activesupport doesn't use auto_require. It'd be interesting to see the "require chain", if the OP can provide it. -- Mauricio Fernandez - http://eigenclass.org - singular Ruby