加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

asset-pipeline – Ruby on Rails 3.2编译的资产不起作用

发布时间:2020-12-14 04:47:08 所属栏目:百科 来源:网络整理
导读:这是Rails资产中的错误吗? 我不明白我做错了什么.你能帮忙吗? 我不想做按需编译…… 错误: Started GET "/" for 127.0.0.1 at 2012-02-02 01:25:44 +0200Processing by StaticPagesController#home as HTML Rendered static_pages/home.html.erb within l
这是Rails资产中的错误吗?
我不明白我做错了什么.你能帮忙吗?
我不想做按需编译……

错误:

Started GET "/" for 127.0.0.1 at 2012-02-02 01:25:44 +0200
Processing by StaticPagesController#home as HTML
  Rendered static_pages/home.html.erb within layouts/application (11.8ms)
  Rendered layouts/_stylesheets.html.erb (3.1ms)
Completed 500 Internal Server Error in 33ms

ActionView::Template::Error (blueprint/screen.css isn't precompiled):
    1: <!--[if lt IE 9]>
    2: <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    3: <![endif]-->
    4: <%= stylesheet_link_tag    'blueprint/screen',media: 'screen' %>
    5: <%= stylesheet_link_tag    'blueprint/print',media: 'print' %>
    6: <!--[if lt IE 8]><%= stylesheet_link_tag 'blueprint/ie' %><![endif]-->
    7: <%= stylesheet_link_tag    "application",:media => "all" %>
  app/views/layouts/_stylesheets.html.erb:4:in `_app_views_layouts__stylesheets_html_erb___420254603692159600_23189320'
  app/views/layouts/application.html.erb:5:in `_app_views_layouts_application_html_erb___3529609308555441821_21997000'

来自production.rb:

config.serve_static_assets = true
...
config.assets.precompile += %w( blueprint/screen.css blueprint/print.css blueprint/ie.css )

来自production.log

Compiled jquery.js  (1ms)  (pid 14042)
Compiled jquery_ujs.js  (0ms)  (pid 14042)
Compiled static_pages.js  (59ms)  (pid 14042)
Compiled users.js  (1ms)  (pid 14042)
Compiled application.js  (84ms)  (pid 14042)
Compiled layout.css  (14ms)  (pid 14042)
Compiled static_pages.css  (0ms)  (pid 14042)
Compiled users.css  (0ms)  (pid 14042)
Compiled application.css  (24ms)  (pid 14042)
Compiled blueprint/ie.css  (0ms)  (pid 14042)
Compiled blueprint/print.css  (0ms)  (pid 14042)
Compiled blueprint/screen.css  (0ms)  (pid 14042)

解决方法

尝试捆绑exec rake资产:预编译 然后检查public / assets文件夹中是否有所有必需的资产.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读