路由中定义如下:
root :to => 'high_voltage/pages#show', :id => 'welcome'
打开首页则报错如下:
NoMethodError at /
undefined method `environment' for nil:NilClass
(in /home/f/RailsPrjects/groupme/app/assets/stylesheets/common.css.scss)
定位错误代码为 app/views/layouts/application.html.erb 文件中的:
<%= stylesheet_link_tag "application" %>
输出的变量信息如下:
Request info
Request parameters
{"id"=>"welcome", "controller"=>"high_voltage/pages", "action"=>"show"}
Local Variables
local_assigns {}
output_buffer nil
_old_virtual_path nil
_old_output_buffer nil
Instance Variables
@_routes nil
@_config {}