我在heroku上遇到堆栈级别太深的错误,但在开发时却没有。我把它缩小到一个文件,但不知道为什么这个文件导致错误。这是文件(_sidebar.html.haml):
.col-md-12
.page-header
%h3= link_to 'Texthub', root_path
%h4{style: 'font-weight:normal;'}= "Your number: #{display_phone_number}"
- if current_user.company.has_name?
= link_to current_user.company.name, current_user.company
(
= link_to 'Invite', new_user_invitation_path
)
- else
= link_to 'Set Company Name', edit_company_path(current_user.company)
%br
= link_to 'Add Customer', new_customer_path
%br
%br
- @sidebar_customers.each do |customer|
= link_to customer.full_name, customer
.badge= customer.not_viewed_count if customer.not_viewed_count > 0
.pull-right
%div{:class => "label label-#{aasm_state_btn_class(customer)}"}
= customer.aasm_state.capitalize
%br
%br
%br
= link_to 'Customers', customers_path
%br
= link_to 'Edit Profile', edit_user_registration_path
%br
= link_to 'Log Out', destroy_user_session_path, method: :delete
和调用此部分的文件:
%body
.container-fluid
.row-fluid{style: 'height:100%; position:absolute; top:0; right:0; bottom:0; left:0;'}
.col-md-3{style: 'height:100%;'}
- if user_signed_in?
= render 'shared/sidebar'
.col-md-9
= bootstrap_flash
= yield
导致此错误的原因是什么?堆栈跟踪:
2014-03-18T21:23:47.908176+00:00 app[web.1]: => Run `rails server -h` for more startup options
2014-03-18T21:23:47.908176+00:00 app[web.1]: => Ctrl-C to shutdown server
2014-03-18T21:23:47.908176+00:00 app[web.1]: Started GET "/" for 23.125.128.198 at 2014-03-18 21:23:47 +0000
2014-03-18T21:23:47.908176+00:00 app[web.1]: Started GET "/" for 23.125.128.198 at 2014-03-18 21:23:47 +0000
2014-03-18T21:23:48.032467+00:00 app[web.1]: Processing by HomeController#index as HTML
2014-03-18T21:23:48.032467+00:00 app[web.1]: Processing by HomeController#index as HTML
2014-03-18T21:23:48.274600+00:00 app[web.1]: Rendered home/_dashboard.html.haml (92.2ms)
2014-03-18T21:23:48.274600+00:00 app[web.1]: Rendered home/_dashboard.html.haml (92.2ms)
2014-03-18T21:23:48.274787+00:00 app[web.1]: Rendered home/index.html.haml within layouts/application (95.1ms)
2014-03-18T21:23:48.274787+00:00 app[web.1]: Rendered home/index.html.haml within layouts/application (95.1ms)
2014-03-18T21:23:48.298939+00:00 app[web.1]: Rendered shared/_sidebar.html.haml (17.9ms)
2014-03-18T21:23:48.299189+00:00 app[web.1]: Rendered shared/_sidebar.html.haml (17.9ms)
2014-03-18T21:23:48.299693+00:00 app[web.1]: Completed 500 Internal Server Error in 267ms
2014-03-18T21:23:48.301532+00:00 heroku[router]: at=info method=GET path=/ host=texthub.herokuapp.com request_id=53a31f14-ec01-41e3-b479-cd25b72ad081 fwd="23.125.128.198" dyno=web.1 connect=1ms service=406ms status=500 bytes=1543
2014-03-18T21:23:48.299755+00:00 app[web.1]: Completed 500 Internal Server Error in 267ms
2014-03-18T21:23:48.300625+00:00 app[web.1]:
2014-03-18T21:23:48.300625+00:00 app[web.1]: ActionView::Template::Error (stack level too deep):
2014-03-18T21:23:48.300625+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.3/lib/active_support/string_inquirer.rb:19
2014-03-18T21:23:48.300625+00:00 app[web.1]:
2014-03-18T21:23:48.300625+00:00 app[web.1]:
2014-03-18T21:23:48.300625+00:00 app[web.1]:
2014-03-18T21:23:48.300625+00:00 app[web.1]: ActionView::Template::Error (stack level too deep):
2014-03-18T21:23:48.300625+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.3/lib/active_support/string_inquirer.rb:19
2014-03-18T21:23:48.300625+00:00 app[web.1]:
2014-03-18T21:23:48.300625+00:00 app[web.1]: