Superclass mismatch for class ModelExampleGroup (TypeError)


#1

I hope somebody can help me with this.

I can’t seem to run spec_server with rails 2.3.2 using rspec/rspec-rails
1.2.2. I’m also using mocha 0.9.5 and remarkable 2.3.0.

Thanks Andrew

Here is the stack trace:


/Library/Ruby/Gems/1.8/gems/rspec-rails-1.2.2/lib/spec/rails/example/model_example_group.rb:9:
superclass mismatch for class ModelExampleGroup (TypeError)

from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in
gem_original_require' from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:inrequire’
from
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:158:in
require' from /Library/Ruby/Gems/1.8/gems/rspec-rails-1.2.2/lib/spec/rails/example.rb:6 from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:ingem_original_require’
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in require' from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:158:inrequire’
from /Library/Ruby/Gems/1.8/gems/rspec-rails-1.2.2/lib/spec/rails.rb:19
… 9 levels…
from /Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/initializer.rb:113:in
run' from ./script/../config/environment.rb:13 from ./script/spec_server:6:inrequire’
from ./script/spec_server:6


View this message in context:
http://www.nabble.com/superclass-mismatch-for-class-ModelExampleGroup-(TypeError)-tp22940271p22940271.html
Sent from the rspec-users mailing list archive at Nabble.com.


#2

On Tue, Apr 7, 2009 at 6:20 PM, Andrew Zielinski
removed_email_address@domain.invalid wrote:

I hope somebody can help me with this.

I can’t seem to run spec_server with rails 2.3.2 using rspec/rspec-rails
1.2.2. I’m also using mocha 0.9.5 and remarkable 2.3.0.

The stack trace doesn’t show it, but the superclass mismatch suggests
that you have a version of rspec pre 1.2 that is being loaded
somewhere. The old ModelExampleGroup derived directly from
Test::Unit::TestCase, but the 1.2 class derives from
ActiveSupport::TestCase. Can you check to see what versions of rspec
and rspec-rails you have installed and uninstall all the old ones if
you can.

HTH,
David


#3

Thanks David,

It seems like remarkable was the culprit. Somebody had posted the same
issue
to lighthouse.
The solution was to specify the lib in environment.rb instead of setting
it
to false for rspec and rspec-rails. The discussion was in Portuguese so
I’m
not sure why this works.

I don’t get the error anymore but now when I run spec_server it hangs.
Running it with debug produced the following output:

-----------Exception LoadError' at /Library/Ruby/Site/1.8/rubygems.rb:871 - no such file to load -- rubygems/defaults/operating_system ExceptionLoadError’ at
/Library/Ruby/Site/1.8/rubygems/config_file.rb:35 -
no such file to load – Win32API
Exception TypeError' at (eval):4 - can't modify frozen object ExceptionMissingSourceFile’ at
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31 - no such file to
load
– fast_xs
Exception `Gem::LoadError’ at /Library/Ruby/Site/1.8/rubygems.rb:636 -
RubyGem version error: rack(0.3.0 not ~> 1.0.0)

Exception `Gem::LoadError’ at /Library/Ruby/Site/1.8/rubygems.rb:636 -
Could
not find RubyGem tmail (~> 1.2.3)

Exception MissingSourceFile' at /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31 - no such file to load -- tmail/tmailscanner ExceptionMissingSourceFile’ at
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:38 - no such file to
load
– tmail/tmailscanner
Exception `MissingSourceFile’ at
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:162

  • no such file to load – tmail/tmailscanner
    /Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/initializer.rb:756: warning:
    instance variable @reload_plugins not initialized
    /Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/initializer.rb:756: warning:
    instance variable @reload_plugins not initialized
    /Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/initializer.rb:756: warning:
    instance variable @reload_plugins not initialized
    /Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/initializer.rb:756: warning:
    instance variable @reload_plugins not initialized

David C.-2 wrote:

that you have a version of rspec pre 1.2 that is being loaded

Thanks Andrew
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in require'require’
View this message in context:
removed_email_address@domain.invalid
http://rubyforge.org/mailman/listinfo/rspec-users


View this message in context:
http://www.nabble.com/superclass-mismatch-for-class-ModelExampleGroup-(TypeError)-tp22940271p22959248.html
Sent from the rspec-users mailing list archive at Nabble.com.


#4

On Wed, Apr 8, 2009 at 5:48 PM, Andrew Zielinski
removed_email_address@domain.invalid wrote:

Thanks David,

It seems like remarkable was the culprit. Somebody had posted the same issue
to lighthouse.

Do you mean rspec’s lighthouse account? If so, which ticket?

no such file to load – Win32API
Win32API??? No idea why that is being loaded (or trying to be).

Exception `MissingSourceFile’ at
/Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/initializer.rb:756: warning:
instance variable @reload_plugins not initialized
/Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/initializer.rb:756: warning:
instance variable @reload_plugins not initialized
/Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/initializer.rb:756: warning:
instance variable @reload_plugins not initialized

There’s not that much help in this backtrace (for me). Anybody else
paying attention and getting some idea about this problem?


#5

It was on remarkable’s lighthouse account.

David C.-2 wrote:

Do you mean rspec’s lighthouse account? If so, which ticket?

-----------Exception `LoadError’ at
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31 - no such file to
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31 - no such file to
instance variable @reload_plugins not initialized

you can.

/Library/Ruby/Gems/1.8/gems/rspec-rails-1.2.2/lib/spec/rails/example.rb:6
from ./script/…/config/environment.rb:13
rspec-users mailing list

removed_email_address@domain.invalid
http://rubyforge.org/mailman/listinfo/rspec-users


View this message in context:
http://www.nabble.com/superclass-mismatch-for-class-ModelExampleGroup-(TypeError)-tp22940271p23000951.html
Sent from the rspec-users mailing list archive at Nabble.com.