Forum: RSpec superclass mismatch for class ModelExampleGroup (TypeError)

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
64aa8f76c4911dd214eeddd94b2ed690?d=identicon&s=25 Andrew Zielinski (Guest)
on 2009-04-08 03:13
(Received via mailing list)
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: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-clas...
Sent from the rspec-users mailing list archive at Nabble.com.
5d38ab152e1e3e219512a9859fcd93af?d=identicon&s=25 David Chelimsky (Guest)
on 2009-04-08 03:34
(Received via mailing list)
On Tue, Apr 7, 2009 at 6:20 PM, Andrew Zielinski
<andrew.zielinski.is@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
64aa8f76c4911dd214eeddd94b2ed690?d=identicon&s=25 Andrew Zielinski (Guest)
on 2009-04-08 22:58
(Received via mailing list)
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:
> 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:
> rspec-users@rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>
>

--
View this message in context:
http://www.nabble.com/superclass-mismatch-for-clas...
Sent from the rspec-users mailing list archive at Nabble.com.
5d38ab152e1e3e219512a9859fcd93af?d=identicon&s=25 David Chelimsky (Guest)
on 2009-04-10 10:48
(Received via mailing list)
On Wed, Apr 8, 2009 at 5:48 PM, Andrew Zielinski
<andrew.zielinski.is@gmail.com> 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?
64aa8f76c4911dd214eeddd94b2ed690?d=identicon&s=25 Andrew Zielinski (Guest)
on 2009-04-11 15:05
(Received via mailing list)
It was on remarkable's lighthouse account.


David Chelimsky-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
>> --
> rspec-users@rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>
>

--
View this message in context:
http://www.nabble.com/superclass-mismatch-for-clas...
Sent from the rspec-users mailing list archive at Nabble.com.
This topic is locked and can not be replied to.