在我的 rails 3.2 应用程序中,使用ruby guides:assets pipelin具有以下布局:
application layout:
...
<%= stylesheet_link_tag :application %>
...
participant layout:
...
<%= stylesheet_link_tag params[:controller] %>
...
在 app/assets/stylesheets 我有 manifest(application.css) 和参与者.css.scss
我在 config/application.rb 中插入,通过heroku assets学习:
config.assets.initialize_on_precompile = false
我已经在我的本地应用程序中完成了“rake assets:precompile”,它使用各种文件创建了公共/资产。
在当地一切正常!
然后,通过Asset Pipeline 在 Heroku Cedar 上的学习,我对存储库进行了提交,并且我确实推送了 Heroku,控制台说:
...
-----> Preparing app for Rails asset pipeline
Detected manifest.yml, assuming assets were compiled locally
...
但是当我打电话给 myApp / 参与者时,它会出现以下错误:
2012-12-05T13:40:08+00:00 app[web.1]: Started GET "/participants" for 2.235.56.84 at 2012-12-05 13:40:08 +0000
2012-12-05T13:40:09+00:00 app[web.1]: Processing by ParticipantsController#index as HTML
2012-12-05T13:40:09+00:00 app[web.1]: Rendered participants/index.html.erb within layouts/participants (4.8ms)
2012-12-05T13:40:09+00:00 app[web.1]: ActionView::Template::Error (participants.css isn't precompiled):
2012-12-05T13:40:09+00:00 app[web.1]: 6: <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
2012-12-05T13:40:09+00:00 app[web.1]:
2012-12-05T13:40:09+00:00 app[web.1]: 5: <head>
2012-12-05T13:40:09+00:00 app[web.1]: 7: <title>Participants: <%= controller.action_name %></title>
2012-12-05T13:40:09+00:00 app[web.1]: 9: </head>
2012-12-05T13:40:09+00:00 app[web.1]: Completed 500 Internal Server Error in 154ms
2012-12-05T13:40:09+00:00 app[web.1]: 8: <%= stylesheet_link_tag params[:controller] %>
2012-12-05T13:40:09+00:00 app[web.1]: 10: <body>
2012-12-05T13:40:09+00:00 app[web.1]: 11:
2012-12-05T13:40:09+00:00 app[web.1]: app/views/layouts/participants.html.erb:8:in `_app_views_layouts_participants_html_erb__1645329556414684428_17128800'
2012-12-05T13:40:09+00:00 app[web.1]: app/controllers/participants_controller.rb:29:in `index'
2012-12-05T13:40:09+00:00 app[web.1]:
2012-12-05T13:40:09+00:00 app[web.1]:
2012-12-05T13:40:13+00:00 heroku[web.1]: Error R12 (Exit timeout) -> At least one process failed to exit within 10 seconds of SIGTERM
2012-12-05T13:40:13+00:00 heroku[web.1]: Stopping remaining processes with SIGKILL
2012-12-05T13:40:15+00:00 heroku[web.1]: Process exited with status 137
而当我调用 myApp/?token=test 然后加载布局/应用程序时,一切正常:
2012-12-05T13:46:06+00:00 app[web.1]: Started GET "/?token=test" for 2.235.56.84 at 2012-12-05 13:46:06 +0000
2012-12-05T13:46:06+00:00 app[web.1]:
2012-12-05T13:46:06+00:00 app[web.1]:
2012-12-05T13:46:06+00:00 app[web.1]: Processing by MainController#index as HTML
2012-12-05T13:46:06+00:00 app[web.1]: Parameters: {"token"=>"test"}
2012-12-05T13:46:06+00:00 app[web.1]: Completed 200 OK in 63ms (Views: 3.7ms | ActiveRecord: 16.0ms)
2012-12-05T13:46:06+00:00 app[web.1]: Rendered main/noYaml.html.erb within layouts/application (0.3ms)
缺少什么或我做错了什么?