Ansd
Ansd

Reputation: 1865

Assets precompile error on Heroku

I'm new to RoR and was trying to deploy to Heroku however its driving me crazy! this is my logs:

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]: 

I tried everything I know to precompile all css & js file but still getting this error I even set config.assets.precompile += ['*.js', '*.css'] but still not working. When I turn config.serve_static_assets to true everything work but as you know it got some disadvantages! Any clue guys?

Upvotes: 0

Views: 1099

Answers (1)

John Beynon
John Beynon

Reputation: 37507

It looks like you're trying to load your scaffold css file directly - line 7 of application.html.erb? I'm not familiar with the tutorial your basing off but typically your stylesheet_link_tag is to application which itself is a manifest file to let sprockets know what needs to be compliled.

Create an application.css file in your assets\stylesheets directory and it should look like;

/*
*= require_self
*= require_tree
*/

You can leave your existing scaffold.css file in place as the require_tree will have sprockets include the file in it's compilation task.

Upvotes: 1

Related Questions