[Rubygems-developers] getting an error using mongrel that might be gem related
Stephen Bannasch
stephen.bannasch at deanbrook.org
Wed Nov 14 00:46:35 EST 2007
At 6:03 PM -0800 11/13/07, Eric Hodel wrote:
>
>Nothing in this stack trace points to RubyGems.
The crash appears to be happening in GemPlugin::Manager.instance.load (but of course things are not always as they appear).
Here's where I am now:
I have a breakpoint on lines 231 and 232 (I added line 232) in a mongrel script . I never get to line 232. The problem seems to occur in GemPlugin::Manager.instance.load. I don't think it's an obvious bug in the Gem code. I expect there is some gem that is screwed up in some way that the causes GemPlugin::Manager.instance.load to blow up.
[226, 235] in /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.1/lib/mongrel/configurator.rb
226 ops[:excludes].each do |plugin|
227 load_settings[plugin] = GemPlugin::EXCLUDE
228 end
229 end
230
=> 231 GemPlugin::Manager.instance.load(load_settings)
232 puts "after looading plugins ..."
233 end
234
235
here the stack:
(rdb:1) where
--> #0 /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.1/lib/mongrel/configurator.rb:231 in 'load_plugins'
#1 /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/mongrel_rails:117 in 'cloaker_'
#2 /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.1/lib/mongrel/configurator.rb:149 in 'call'
#3 /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/mongrel_rails:99 in 'cloaker_'
#4 /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.1/lib/mongrel/configurator.rb:50 in 'call'
#5 /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/mongrel_rails:84 in 'new'
#6 /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/mongrel_rails:84 in 'run'
#7 /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.1/lib/mongrel/command.rb:212 in 'run'
#8 /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.1/bin/mongrel_rails:281
#9 /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:488 in 'load'
#10 /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:488 in 'load'
#11 /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.5/lib/commands/servers/mongrel.rb:60
#12 /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27 in 'require'
#13 /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:495 in 'require'
#14 /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:495 in 'require'
#15 /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.5/lib/commands/server.rb:39
#16 /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27 in 'require'
#17 ./script/server.rb:3
and here's the stacktrace from the error:
(rdb:1) cont
Exiting
/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.5/lib/commands/servers/mongrel.rb:15: warning: already initialized constant OPTIONS
/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.5/lib/commands/servers/mongrel.rb:18: undefined method `options' for []:Array (NoMethodError)
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in `gem_original_require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in `require'
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:495:in `require'
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:342:in `new_constants_in'
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:495:in `require'
from /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.5/lib/commands/server.rb:39
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
from ./script/server.rb:3
from /usr/local/lib/ruby/gems/1.8/gems/ruby-debug-0.9.3/bin/rdebug:136:in `debug_load'
from /usr/local/lib/ruby/gems/1.8/gems/ruby-debug-0.9.3/bin/rdebug:136
from /usr/local/bin/rdebug:16:in `load'
from /usr/local/bin/rdebug:16
---------------------------------------
Here's what I found tracing GemPlugin::Manager.instance.load:
I setup this conditional break at line 115 (gems.length == 315):
b /usr/local/lib/ruby/gems/1.8/gems/gem_plugin-0.2.3/lib/gem_plugin.rb:115 if gem.name == "daemons"
/usr/local/lib/ruby/gems/1.8/gems/gem_plugin-0.2.3/lib/gem_plugin.rb:115 check = needs.dup
[110, 119] in /usr/local/lib/ruby/gems/1.8/gems/gem_plugin-0.2.3/lib/gem_plugin.rb
110 needs = needs.merge({"gem_plugin" => INCLUDE})
111
112 gems.each do |path, gem|
113 # don't load gems more than once
114 next if @gems.has_key? gem.name
=> 115 check = needs.dup
116
117 # rolls through the depends and inverts anything it finds
118 gem.dependencies.each do |dep|
119 # this will fail if a gem is depended more than once
On the 10th pass through the conditional break at 115. I get the next two startup messages displayed:
(rdb:1) cont
** Rails loaded.
** Loading any Rails specific GemPlugins
Breakpoint 1 at /usr/local/lib/ruby/gems/1.8/gems/gem_plugin-0.2.3/lib/gem_plugin.rb:115
But after four more times through the conditional break at 115 I get back to the error described above:
I still need to do more work to complete tracing the path to the error.
More information about the Rubygems-developers
mailing list