[rspec-users] any idea why spec_server gets 'cannot remove Object' error?

David Chelimsky dchelimsky at gmail.com
Tue Jun 23 10:19:02 EDT 2009


On Tue, Jun 23, 2009 at 4:12 AM, Tom Hoen<lists at ruby-forum.com> wrote:
> I am sure better minds than mine can figure this out, but I am stumped.
>
> When I run any spec using spec_server, a get 0 failures and the command
> prompt returns without issue.
>
> If I run the same spec again, I still get 0 failures, but it concludes
> with the following error:
>
> (druby://127.0.0.1:8989)
> c:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:603:in
> `remove_const': Cannot remove Object::ClassMethods (NameError)
>        from (druby://127.0.0.1:8989)
> c:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:603:in
> `remove_constant'
>        from (druby://127.0.0.1:8989)
> c:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:603:in
> `instance_eval'
>        from (druby://127.0.0.1:8989)
> c:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:603:in
> `remove_constant'
>        from (druby://127.0.0.1:8989)
> c:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:450:in
> `remove_unloadable_constants!'
>        from (druby://127.0.0.1:8989)
> c:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:450:in
> `each'
>        from (druby://127.0.0.1:8989)
> c:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:450:in
> `remove_unloadable_constants!'
>        from (druby://127.0.0.1:8989)
> c:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:236:in
> `clear'
>        from (druby://127.0.0.1:8989)
> c:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/dispatcher.rb:65:in
> `cleanup_application'
>        from (druby://127.0.0.1:8989)
> c:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/rspec-rails-1.2.6/lib/spec/rails/spec_server.rb:106:in
> `run'
>        from
> c:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/rspec-1.2.6/lib/spec/runner/drb_command_line.rb:14:in
> `run'
>        from
> c:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/rspec-1.2.6/lib/spec/runner/option_parser.rb:193:in
> `parse_drb'
>        from
> c:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/rspec-1.2.6/lib/spec/runner/option_parser.rb:130:in
> `order!'
>        from
> c:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/rspec-1.2.6/lib/spec/runner.rb:51:in
> `options'
>        from
> c:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/rspec-1.2.6/lib/spec/runner/command_line.rb:6:in
> `run'
>        from
> c:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/rspec-1.2.6/bin/spec:4
>        from c:/InstantRails-2.0-win/ruby/bin/spec:19:in `load'
>        from c:/InstantRails-2.0-win/ruby/bin/spec:19
>
>
> running the spec a third time, most of my tests fail with the following
> sample error:
> TypeError in 'School can add staff_members'
> can't dup NilClass
>
> If I kill the spec_server, restart it, the cycle begins again.
>
> Previously, spec server ran without issue, using individual

Previously to what? What changed?

Also - just a heads up that spec_server is deprecated in 1.2.7 and
will be removed in 1.2.8. I prefer to avoid removing things in point
releases, but spec_server has been problematic (behaving very
differently for a lot of different environments and configurations),
and Tim Harper's new spork gem [1] serves the same purpose in a very
elegant way, so the migration path is simple.

gem install spork
cd path/to/project
spork bootstrap --rspec
# edit spec/spec_helper.rb

You may have better luck if you migrate now.

Cheers,
David

[1] http://github.com/timcharper/spork

>
> I am running:
> rspec and rspec on rails 1.2.6
> Rails 2.3.2
> ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]
> Windows Vista
>
> Any thoughts would be greatly appreciated.
>
> Tom
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>


More information about the rspec-users mailing list