[rspec-users] superclass mismatch for class ModelExampleGroup (TypeError)

Andrew Zielinski andrew.zielinski.is at gmail.com
Wed Apr 8 16:48:19 EDT 2009


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
Exception `LoadError' 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
Exception `MissingSourceFile' 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
Exception `MissingSourceFile' 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 Chelimsky-2 wrote:
> 
> On Tue, Apr 7, 2009 at 6:20 PM, Andrew Zielinski
> <andrew.zielinski.is at gmail.com> 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
> 
>>
>> 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:in `require'
>> 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:in
>> `gem_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:in
>> `require'
>> 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:in `require'
>> from ./script/spec_server:6
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/superclass-mismatch-for-class-ModelExampleGroup-%28TypeError%29-tp22940271p22940271.html
>> Sent from the rspec-users mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> rspec-users mailing list
>> rspec-users at rubyforge.org
>> http://rubyforge.org/mailman/listinfo/rspec-users
>>
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
> 
> 

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



More information about the rspec-users mailing list