Rails测试系统堆栈错误

时间:2010-04-14 14:14:45

标签: ruby-on-rails testing rcov

暂停后我恢复测试我的rails应用程序。在我的rails应用程序上运行测试现在返回SystemStackError。即使是像

这样的简单测试

def test_per_page

assert_instance_of Fixnum,Activity.per_page

给了我

C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/core_ext/m odule / introspection.rb:74:在`local_constants'中:堆栈级别太深(SystemStac) kError)

 from C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/core_ext/module/introspection.rb:73:in `select'
 from C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/core_ext/module/introspection.rb:73:in `local_constants'
 from C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/core_ext/module/introspection.rb:86:in `local_constant_names'
 from C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:531:in `new_constants_in'
 from C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:525:in `collect'
 from C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:525:in `new_constants_in'
 from C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
 from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/rails/plugin/locator.rb:89:in `plugins'
  ... 12095 levels...
 from ./unit/../test_helper.rb:2
 from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
 from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
 from unit/my_test.rb:1

我发现我们安装了测试单元gem并将其删除..即便如此,同样的问题仍然会突然出现。我在使用rcov的同时安装了rcov,同样的东西..

C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/specification.rb:666:在'hash'中:堆栈级别太深(SystemStackError)

    from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `inject'
    from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/specification.rb:664:in `each'
    from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/specification.rb:664:in `inject'
    from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/specification.rb:664:in `hash'
    from C:/Ruby/lib/ruby/1.8/tsort.rb:219:in `[]='
    from C:/Ruby/lib/ruby/1.8/tsort.rb:219:in `each_strongly_connected_component_from'
    from C:/Ruby/lib/ruby/1.8/tsort.rb:219:in `each'
    from C:/Ruby/lib/ruby/1.8/tsort.rb:219:in `each_strongly_connected_component_from'
     ... 12099 levels...
    from C:/Ruby/lib/ruby/gems/1.8/gems/rcov-0.8.1.2.0-x86-mswin32/bin/rcov:554:in `load'
    from C:/Ruby/lib/ruby/gems/1.8/gems/rcov-0.8.1.2.0-x86-mswin32/bin/rcov:554
    from C:/Ruby/bin/rcov:19:in `load'
    from C:/Ruby/bin/rcov:19

有没有人曾经遇到过这样的事情..我明白宝石需要被一遍又一遍地调用..有没有办法解决这个问题?

1 个答案:

答案 0 :(得分:0)

哎呀!当环境启动时,我有两个初始化程序为rcov运行。一个位于environment.rb文件中,另一个位于config文件夹中env子文件夹中的单独test.rb文件中。所以它一直在继续循环。无论如何问题解决了,地球仍在旋转。

由于