ActionView::Template::Error (application.css isn't precompiled) Rails
Asked Answered
B

1

0

I'm getting below in my production server:

Started GET "/" for 101.160.190.206 at 2013-09-05 00:11:28 +1000
Processing by HomeController#index as HTML
  Rendered home/index.html.erb within layouts/application (0.5ms)
Completed 500 Internal Server Error in 2ms

ActionView::Template::Error (application.css isn't precompiled):
    4:     <meta name="viewport" content="width=device-width, initial-scale=1.0">
    5:     <title><%= content_for?(:title) ? yield(:title) : "Tools" %></title>
    6:     <meta name="description" content="<%= content_for?(:description) ? yield(:description) : "Tools" %>">
    7:     <%= stylesheet_link_tag "application", :media => "all" %>
    8:     <%= javascript_include_tag "application" %>
    9:     <%= csrf_meta_tags %>
    10:     <%= yield(:head) %>
  app/views/layouts/application.html.erb:7:in `_app_views_layouts_application_html_erb__153052184121312410_16560580'

I ran rake assets:precompile and it seems to compile correctly as I can see in the assets file but I'm still getting

We're sorry, but something went wrong.

error.

I'm not sure where it went wrong...

Baecher answered 4/9, 2013 at 14:20 Comment(4)
where did you run the precompile? on the server? or your localbox? how do you deploy to production?Watercolor
Ran on the server on directory it was deployedBaecher
did you restart the server after you compiled?Watercolor
You are right. I did restart and it worked!Baecher
I
1

If you haven't modified anything application.css should be included by default into assets, so try running:

RAILS_ENV=production rake assets:precompile

instead of

rake assets:precompile

which takes default environment which is by default development. At least that was an 'issue' I've faced several weeks ago, so maybe it's same in that case.

Ingressive answered 4/9, 2013 at 14:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.