super: no superclass method `require’ (NoMethodError)

July 30th, 2008

I had an issue a few hours ago where I was getting the following message when running script/server after trying to do a deployment.

super: no superclass method `require' (NoMethodError)

The problem seemed to be a mix of haml and rails 2.1. It worked on my development machine though, so there is probably something more to it than that.

After spending some time trying to find the issue I eventually found that this was the reason of failure :

(/usr/lib/ruby/gems/1.8/gems/haml-2.0.1/lib/haml.rb:1033):


%w[haml/template sass sass/plugin].each(&method(:require))

I wasn’t totally sure what that is expected to do. I figured at first maybe it was supposed to be a Symbol#to_proc conversion, but method isn’t a symbol, so I’m still not totally sure what that is supposed to do. Anyway, what’s important is that I replaced it with:


%w[haml/template sass sass/plugin].each { |x| require x }

After that everything worked just fine.

The full trace I received with the error is listed below:

=> Booting Mongrel (use 'script/server webrick' to force WEBrick)
=> Rails 2.1.0 application starting on http://0.0.0.0:1200
=> Call with -d to detach
=> Ctrl-C to shutdown server
** Starting Mongrel listening at 0.0.0.0:1200
** Starting Rails with production environment...
Exiting
/var/www/apps/domain/releases/20080730050116/vendor/rails/activesupport/lib/active_support/dependencies.rb:144:in `require': super: no superclass method `require' (NoMethodError)
from /var/www/apps/domain/releases/20080730050116/vendor/rails/activesupport/lib/active_support/dependencies.rb:503:in `new_constants_in'
from /var/www/apps/domain/releases/20080730050116/vendor/rails/activesupport/lib/active_support/dependencies.rb:144:in `require'
from /var/www/apps/domain/releases/20080730050116/vendor/rails/activesupport/lib/active_support/core_ext/module/attribute_accessors.rb:36:in `to_proc'
from /usr/lib/ruby/gems/1.8/gems/haml-2.0.1/lib/haml.rb:1033:in `each'
from /usr/lib/ruby/gems/1.8/gems/haml-2.0.1/lib/haml.rb:1033:in `init_rails'
from /var/www/apps/domain/releases/20080730050116/vendor/plugins/haml/init.rb:7:in `evaluate_init_rb'
from ./script/../config/../vendor/rails/railties/lib/rails/plugin.rb:103:in `evaluate_init_rb'
from /var/www/apps/domain/releases/20080730050116/vendor/rails/activesupport/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'
from ./script/../config/../vendor/rails/railties/lib/rails/plugin.rb:99:in `evaluate_init_rb'
from ./script/../config/../vendor/rails/railties/lib/rails/plugin.rb:44:in `load'
from ./script/../config/../vendor/rails/railties/lib/rails/plugin/loader.rb:33:in `load_plugins'
from ./script/../config/../vendor/rails/railties/lib/rails/plugin/loader.rb:32:in `each'
from ./script/../config/../vendor/rails/railties/lib/rails/plugin/loader.rb:32:in `load_plugins'
from ./script/../config/../vendor/rails/railties/lib/initializer.rb:311:in `load_plugins'
from ./script/../config/../vendor/rails/railties/lib/initializer.rb:150:in `process'
from ./script/../config/../vendor/rails/railties/lib/initializer.rb:105:in `send'
from ./script/../config/../vendor/rails/railties/lib/initializer.rb:105:in `run'
from /var/www/apps/domain/releases/20080730050116/config/environment.rb:13
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
from /var/www/apps/domain/releases/20080730050116/vendor/rails/activesupport/lib/active_support/dependencies.rb:144:in `require'
from /var/www/apps/domain/releases/20080730050116/vendor/rails/activesupport/lib/active_support/dependencies.rb:503:in `new_constants_in'
from /var/www/apps/domain/releases/20080730050116/vendor/rails/activesupport/lib/active_support/dependencies.rb:144:in `require'
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:147:in `rails'
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:113:in `cloaker_'
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:149:in `call'
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:149:in `listener'
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:99:in `cloaker_'
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:50:in `call'
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:50:in `initialize'
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:84:in `new'
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:84:in `run'
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/command.rb:212:in `run'
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281
from /var/www/apps/domain/releases/20080730050116/vendor/rails/activesupport/lib/active_support/dependencies.rb:137:in `load_without_new_constant_marking'
from /var/www/apps/domain/releases/20080730050116/vendor/rails/activesupport/lib/active_support/dependencies.rb:137:in `load'
from /var/www/apps/domain/releases/20080730050116/vendor/rails/activesupport/lib/active_support/dependencies.rb:503:in `new_constants_in'
from /var/www/apps/domain/releases/20080730050116/vendor/rails/activesupport/lib/active_support/dependencies.rb:137:in `load'
from /var/www/apps/domain/releases/20080730050116/vendor/rails/railties/lib/commands/servers/mongrel.rb:64
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
from /var/www/apps/domain/releases/20080730050116/vendor/rails/activesupport/lib/active_support/dependencies.rb:144:in `require'
from /var/www/apps/domain/releases/20080730050116/vendor/rails/activesupport/lib/active_support/dependencies.rb:503:in `new_constants_in'
from /var/www/apps/domain/releases/20080730050116/vendor/rails/activesupport/lib/active_support/dependencies.rb:144:in `require'
from /var/www/apps/domain/releases/20080730050116/vendor/rails/railties/lib/commands/server.rb:49
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
from script/server:3

Leave a comment