Ruby on rails 3 运行Cumber时出现操作视图模板错误

Ruby on rails 3 运行Cumber时出现操作视图模板错误,ruby-on-rails-3,cucumber,capybara,bdd,Ruby On Rails 3,Cucumber,Capybara,Bdd,下面是一个黄瓜场景: Scenario: Login Given the user is on Login page When I sign in 我的步骤定义: When /I sign in/ do within("#mypage") do fill_in 'login_id', :with => 'ccd' fill_in 'password', :with => 'coffee' end click_button 'Login' visit

下面是一个黄瓜场景:

Scenario: Login
Given the user is on Login page
When I sign in
我的步骤定义:

When /I sign in/ do
  within("#mypage") do
    fill_in 'login_id', :with => 'ccd'
    fill_in 'password', :with => 'coffee'
  end
  click_button 'Login'
  visit '/feedbacks/'
end
当我运行cucumber时,会出现以下错误:

Scenario: Login                 # features\heartbeat_tests.feature:20
Given the user is on Login page # features/step_definitions/heartbeat_definitions.rb:5
When I sign in                  # features/step_definitions/heartbeat_definitions.rb:18
undefined method `each' for nil:NilClass (ActionView::Template::Error)
D:/shoutout_web/app/views/layouts/application.html.erb:256:in          
`_app_views_layouts_application_html_erb__124036717_28160832'

您必须共享application.html.erb第256行的内容。另外,heartbeat_definitions.rb的第18行是什么?Hi@Geoff这里是appliaction.html.erb definitions.rb的第250到256行,当/I登录/do within mypage do fill_in‘login_id’,:with=>‘ccd’fill_in‘password’,:with=>'coffee'结束点击按钮'Login'visit'/feedbacks/'end你能用这些代码行编辑原始问题吗?很难在评论中读到它们。请确保也包括Definitions.rb的行号。