1

私の Rails 3.2 アプリには、ruby​​ guides:assets pipelinを使用して次のレイアウトがあります。

application layout:
...
<%= stylesheet_link_tag :application %>
...

participant layout:
...
<%= stylesheet_link_tag params[:controller] %>
...

そして app/assets/stylesheets にはマニフェスト(application.css)とparticipant.css.scssがあります

config/application.rb にheroku assetsで学習して挿入しました:

config.assets.initialize_on_precompile = false

そして、ローカル アプリで「rake assets:precompile」を実行し、さまざまなファイルで public/assets を作成しました。

ローカルではすべて正常に動作します!!

次に、 Heroku Cedar の Asset Pipelineで学習し、リポジトリにコミットして 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)

何が足りないのか、何が間違っていたのですか?

4

0 に答える 0