繁体   English   中英

Rails测试系统堆栈错误

[英]Rails Testing System Stack Error

挂起后,我恢复了对Rails应用程序的测试。 在我的rails应用程序上运行测试现在返回SystemStackError。 甚至像一个简单的测试

def test_per_page

固定编号的assert_instance_of,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:in`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

以前有没有人遇到过这样的事情。.我知道gem require会被一遍又一遍地调用..有没有解决的办法?

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

谢谢

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM