rubyeruby

Ruby error "Superclass mismatch for for class Cookie" from cgi.rb


I've just updated my ruby installation on my gentoo server to ruby 1.8.6 patchlevel 287 and have started getting an error on one of my eRuby apps. The error given in the apache error_log file is:

[error] mod_ruby: /usr/lib/ruby/1.8/cgi.rb:774: superclass mismatch for class Cookie (TypeError)

The strange thing is that it seems to work sometimes - but other times I get that error. Anyone any ideas?


Solution

  • That error shows up when you redeclare a class that’s already been declared, most likely because you’re loading two different copies of cgi.rb. See a similar issue in Rails.