我不断收到此错误,无法理解此问题。因为整个堆栈没有我的任何代码。我唯一的提示是,这是在git合并之后开始发生的。
这是错误堆栈,如果您有任何线索,请告诉我。感谢
NoMethodError: undefined method `each' for nil:NilClass
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.2.1/lib/ac
tion_controller/test_case.rb:58:in `teardown_subscriptions'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.2.1/lib
/active_support/callbacks.rb:432:in `block in make_lambda'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.2.1/lib
/active_support/callbacks.rb:263:in `call'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.2.1/lib
/active_support/callbacks.rb:263:in `block in simple'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.2.1/lib
/active_support/callbacks.rb:506:in `call'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.2.1/lib
/active_support/callbacks.rb:506:in `block in call'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.2.1/lib
/active_support/callbacks.rb:506:in `each'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.2.1/lib
/active_support/callbacks.rb:506:in `call'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.2.1/lib
/active_support/callbacks.rb:92:in `_run_callbacks'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.2.1/lib
/active_support/callbacks.rb:776:in `_run_teardown_callbacks'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.2.1/lib
/active_support/callbacks.rb:81:in `run_callbacks'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.2.1/lib
/active_support/testing/setup_and_teardown.rb:45:in `after_teardown'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activerecord-4.2.1/lib/
active_record/fixtures.rb:829:in `after_teardown'
答案 0 :(得分:1)
其中一个模型验证在加载fixture时失败。没有抛出此验证错误,测试用例失败,并显示消息'NoMethodError:undefined method` each'for nil:NilClass'