ActionView::Template::Error(application.css 未预编译)Rails [英] ActionView::Template::Error (application.css isn't precompiled) Rails

查看:46
本文介绍了ActionView::Template::Error(application.css 未预编译)Rails的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的生产服务器低于:

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'

我运行了 rake assets:precompile 并且它似乎正确编译,正如我在资产文件中看到的那样,但我仍然得到

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.

错误.

我不知道哪里出错了...

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

推荐答案

如果你还没有修改任何东西 application.css 应该默认包含在 assets 中,所以尝试运行:

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

RAILS_ENV=production rake assets:precompile

代替

rake assets:precompile

采用默认环境,默认为development.至少这是我几周前遇到的一个问题",所以在这种情况下可能是一样的.

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.

这篇关于ActionView::Template::Error(application.css 未预编译)Rails的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆