Heroku上的资产预编译错误

时间:2012-04-21 19:38:57

标签: ruby-on-rails-3.1 heroku

我是RoR的新手并试图部署到Heroku,但它让我疯狂!这是我的日志:

2012-04-21T19:32:27+00:00 app[web.1]: 
2012-04-21T19:32:27+00:00 app[web.1]: 
2012-04-21T19:32:27+00:00 app[web.1]: Started GET "/" for 89.240.212.20 at 2012-04-21 19:32:27 +0000
2012-04-21T19:32:27+00:00 app[web.1]: Processing by StoreController#index as HTML
2012-04-21T19:32:27+00:00 app[web.1]:   Rendered store/index.html.erb within layouts/application (86.1ms)
2012-04-21T19:32:27+00:00 app[web.1]: Completed 500 Internal Server Error in 266ms
2012-04-21T19:32:27+00:00 app[web.1]: 
2012-04-21T19:32:27+00:00 app[web.1]: ActionView::Template::Error (scaffold.css isn't precompiled):
2012-04-21T19:32:27+00:00 app[web.1]:     4: <head>
2012-04-21T19:32:27+00:00 app[web.1]:     5:   <title>Pragprog Books Online Store</title>
2012-04-21T19:32:27+00:00 app[web.1]:     6: <!-- START:stylesheet -->
2012-04-21T19:32:27+00:00 app[web.1]:     7:   <%= stylesheet_link_tag "scaffold" %>
2012-04-21T19:32:27+00:00 app[web.1]:     8:   <%= stylesheet_link_tag "depot", :media => "all" %><!-- <label id="code.slt"/> -->
2012-04-21T19:32:27+00:00 app[web.1]:     9: <!-- END:stylesheet -->
2012-04-21T19:32:27+00:00 app[web.1]:   app/views/layouts/application.html.erb:7:in `_app_views_layouts_application_html_erb__3129246563521504454_25831520'
2012-04-21T19:32:27+00:00 app[web.1]:     10:   <%= javascript_include_tag :defaults %>
2012-04-21T19:32:27+00:00 app[web.1]: 
2012-04-21T19:32:27+00:00 app[web.1]: 
2012-04-21T19:32:27+00:00 heroku[router]: GET depotalghamdi.herokuapp.com/ dyno=web.1 queue=0 wait=0ms service=384ms status=500 bytes=643
2012-04-21T19:32:28+00:00 heroku[router]: GET depotalghamdi.herokuapp.com/favicon.ico dyno=web.1 queue=0 wait=0ms service=10ms status=200 bytes=0
2012-04-21T19:32:28+00:00 heroku[web.1]: Error R12 (Exit timeout) -> Process failed to exit within 10 seconds of SIGTERM
2012-04-21T19:32:28+00:00 heroku[web.1]: Stopping process with SIGKILL
2012-04-21T19:32:29+00:00 heroku[web.1]: Process exited with status 137
2012-04-21T19:33:09+00:00 app[web.1]: 
2012-04-21T19:33:09+00:00 app[web.1]: 
2012-04-21T19:33:09+00:00 app[web.1]: Processing by StoreController#index as HTML
2012-04-21T19:33:09+00:00 app[web.1]: Started GET "/" for 89.240.212.20 at 2012-04-21 19:33:09 +0000
2012-04-21T19:33:09+00:00 app[web.1]:   Rendered store/index.html.erb within layouts/application (1.6ms)
2012-04-21T19:33:09+00:00 app[web.1]: Completed 500 Internal Server Error in 7ms
2012-04-21T19:33:09+00:00 app[web.1]: 
2012-04-21T19:33:09+00:00 app[web.1]: ActionView::Template::Error (scaffold.css isn't precompiled):
2012-04-21T19:33:09+00:00 app[web.1]:     4: <head>
2012-04-21T19:33:09+00:00 app[web.1]:     5:   <title>Pragprog Books Online Store</title>
2012-04-21T19:33:09+00:00 app[web.1]:     8:   <%= stylesheet_link_tag "depot", :media => "all" %><!-- <label id="code.slt"/> -->
2012-04-21T19:33:09+00:00 app[web.1]:     6: <!-- START:stylesheet -->
2012-04-21T19:33:09+00:00 app[web.1]:     7:   <%= stylesheet_link_tag "scaffold" %>
2012-04-21T19:33:09+00:00 app[web.1]:     9: <!-- END:stylesheet -->
2012-04-21T19:33:09+00:00 app[web.1]:     10:   <%= javascript_include_tag :defaults %>
2012-04-21T19:33:09+00:00 app[web.1]:   app/views/layouts/application.html.erb:7:in `_app_views_layouts_application_html_erb__3129246563521504454_25831520'
2012-04-21T19:33:09+00:00 app[web.1]: 
2012-04-21T19:33:09+00:00 app[web.1]: 
2012-04-21T19:33:09+00:00 heroku[router]: GET depotalghamdi.herokuapp.com/ dyno=web.1 queue=0 wait=0ms service=19ms status=500 bytes=643
2012-04-21T19:33:10+00:00 heroku[router]: GET depotalghamdi.herokuapp.com/favicon.ico dyno=web.1 queue=0 wait=0ms service=34ms status=304 bytes=0
2012-04-21T19:33:11+00:00 heroku[router]: GET depotalghamdi.herokuapp.com/ dyno=web.1 queue=0 wait=0ms service=31ms status=500 bytes=643
2012-04-21T19:33:11+00:00 app[web.1]: 
2012-04-21T19:33:11+00:00 app[web.1]: 
2012-04-21T19:33:11+00:00 app[web.1]: Processing by StoreController#index as HTML
2012-04-21T19:33:11+00:00 app[web.1]: Started GET "/" for 89.240.212.20 at 2012-04-21 19:33:11 +0000
2012-04-21T19:33:11+00:00 app[web.1]: Completed 500 Internal Server Error in 12ms
2012-04-21T19:33:11+00:00 app[web.1]: 
2012-04-21T19:33:11+00:00 app[web.1]: ActionView::Template::Error (scaffold.css isn't precompiled):
2012-04-21T19:33:11+00:00 app[web.1]:     5:   <title>Pragprog Books Online Store</title>
2012-04-21T19:33:11+00:00 app[web.1]:     4: <head>
2012-04-21T19:33:11+00:00 app[web.1]:   Rendered store/index.html.erb within layouts/application (1.4ms)
2012-04-21T19:33:11+00:00 app[web.1]:     7:   <%= stylesheet_link_tag "scaffold" %>
2012-04-21T19:33:11+00:00 app[web.1]: 
2012-04-21T19:33:11+00:00 app[web.1]:     8:   <%= stylesheet_link_tag "depot", :media => "all" %><!-- <label id="code.slt"/> -->
2012-04-21T19:33:11+00:00 app[web.1]:     9: <!-- END:stylesheet -->
2012-04-21T19:33:11+00:00 app[web.1]:     10:   <%= javascript_include_tag :defaults %>
2012-04-21T19:33:11+00:00 app[web.1]:   app/views/layouts/application.html.erb:7:in `_app_views_layouts_application_html_erb__3129246563521504454_25831520'
2012-04-21T19:33:11+00:00 app[web.1]: 
2012-04-21T19:33:11+00:00 app[web.1]:     6: <!-- START:stylesheet -->
2012-04-21T19:33:13+00:00 app[web.1]: 
2012-04-21T19:33:13+00:00 app[web.1]: 
2012-04-21T19:33:13+00:00 app[web.1]: Processing by StoreController#index as HTML
2012-04-21T19:33:13+00:00 app[web.1]: Started GET "/" for 89.240.212.20 at 2012-04-21 19:33:13 +0000
2012-04-21T19:33:13+00:00 app[web.1]:   Rendered store/index.html.erb within layouts/application (14.5ms)
2012-04-21T19:33:13+00:00 app[web.1]: Completed 500 Internal Server Error in 66ms
2012-04-21T19:33:13+00:00 app[web.1]: ActionView::Template::Error (scaffold.css isn't precompiled):
2012-04-21T19:33:13+00:00 app[web.1]:     4: <head>
2012-04-21T19:33:13+00:00 app[web.1]: 
2012-04-21T19:33:13+00:00 app[web.1]:     5
:   <title>Pragprog Books Online Store</title>
2012-04-21T19:33:13+00:00 app[web.1]:     6: <!-- START:stylesheet -->
2012-04-21T19:33:13+00:00 app[web.1]:     7:   <%= stylesheet_link_tag "scaffold" %>
2012-04-21T19:33:13+00:00 app[web.1]:     8:   <%= stylesheet_link_tag "depot", :media => "all" %><!-- <label id="code.slt"/> -->
2012-04-21T19:33:13+00:00 app[web.1]:     9: <!-- END:stylesheet -->
2012-04-21T19:33:13+00:00 app[web.1]:   app/views/layouts/application.html.erb:7:in `_app_views_layouts_application_html_erb__3129246563521504454_25831520'
2012-04-21T19:33:13+00:00 app[web.1]:     10:   <%= javascript_include_tag :defaults %>
2012-04-21T19:33:13+00:00 app[web.1]: 
2012-04-21T19:33:13+00:00 app[web.1]: 
2012-04-21T19:33:13+00:00 heroku[router]: GET depotalghamdi.herokuapp.com/ dyno=web.1 queue=0 wait=0ms service=89ms status=500 bytes=643
2012-04-21T19:33:15+00:00 app[web.1]: 
2012-04-21T19:33:15+00:00 app[web.1]: 
2012-04-21T19:33:15+00:00 app[web.1]: Started GET "/" for 89.240.212.20 at 2012-04-21 19:33:15 +0000
2012-04-21T19:33:15+00:00 app[web.1]: Processing by StoreController#index as HTML
2012-04-21T19:33:15+00:00 app[web.1]:   Rendered store/index.html.erb within layouts/application (1.4ms)
2012-04-21T19:33:15+00:00 app[web.1]: Completed 500 Internal Server Error in 20ms
2012-04-21T19:33:15+00:00 app[web.1]: 
2012-04-21T19:33:15+00:00 app[web.1]:     4: <head>
2012-04-21T19:33:15+00:00 app[web.1]:     6: <!-- START:stylesheet -->
2012-04-21T19:33:15+00:00 app[web.1]: ActionView::Template::Error (scaffold.css isn't precompiled):
2012-04-21T19:33:15+00:00 app[web.1]:     7:   <%= stylesheet_link_tag "scaffold" %>
2012-04-21T19:33:15+00:00 app[web.1]:     5:   <title>Pragprog Books Online Store</title>
2012-04-21T19:33:15+00:00 app[web.1]:     9: <!-- END:stylesheet -->
2012-04-21T19:33:15+00:00 app[web.1]:     10:   <%= javascript_include_tag :defaults %>
2012-04-21T19:33:15+00:00 app[web.1]:     8:   <%= stylesheet_link_tag "depot", :media => "all" %><!-- <label id="code.slt"/> -->
2012-04-21T19:33:15+00:00 app[web.1]:   app/views/layouts/application.html.erb:7:in `_app_views_layouts_application_html_erb__3129246563521504454_25831520'
2012-04-21T19:33:15+00:00 app[web.1]: 
2012-04-21T19:33:15+00:00 heroku[router]: GET depotalghamdi.herokuapp.com/ dyno=web.1 queue=0 wait=0ms service=65ms status=500 bytes=643
2012-04-21T19:33:15+00:00 app[web.1]: 

我尝试了所有我知道的预编译所有css&amp; js文件,但仍然收到此错误我甚至设置config.assets.precompile += ['*.js', '*.css']但仍然无法正常工作。 当我将config.serve_static_assets转换为true时,一切正常,但正如您所知,它有一些缺点! 任何线索的人?

1 个答案:

答案 0 :(得分:1)

看起来您正在尝试直接加载您的脚手架css文件 - application.html.erb的第7行?我不熟悉你的基础教程,但通常你的stylesheet_link_tagapplicationapplication.css本身就是一个清单文件,让链轮知道什么需要被编译。

在assets \ stylesheets目录中创建一个/* *= require_self *= require_tree */ 文件,它应该看起来像;

{{1}}

您可以保留现有的scaffold.css文件,因为require_tree将sprockets包含在其编译任务中的文件。