相关疑难解决方法(0)

blueprint/screen.css未预编译

我一直在关注Michael Hartl出色的RoR教程,但我正在使用RoR 3.1.我是RoR 3.1的新手,需要有关资产管道的帮助.这是我的问题:

在继续讨论第5.3节之前,我想我想推进Heroku,看看事情是如何发展的.令我惊讶的是"GET /"导致错误500.在我的本地开发环境中一切都很好.然后我尝试在production-environment(rails s -e production)下运行我的本地sample_app .相同的结果,错误500:

Sprockets::Helpers::RailsHelper::AssetPaths::AssetNotPrecompiledError in Pages#home

Showing /Users/john/Projects/sample_app/app/views/layouts/_stylesheets.html.erb where line #4 raised:

blueprint/screen.css isn't precompiled
Run Code Online (Sandbox Code Playgroud)

支持信息:

  1. 我把blueprint CSS目录放在vendor/assets/stylesheets下.
  2. 我按照Michael的第13.1.4节建议进行操作,并将以下内容作为我的app/views/layouts/application.html.erb:

    <!DOCTYPE html>
    <html>
      <head>
        <title><%= title %></title>
        <%= render 'layouts/stylesheets' %>
        <%= stylesheet_link_tag "application" %>
        <%= javascript_include_tag "application" %>
        <%= csrf_meta_tags %>
      </head>
      <body>
        <div class="container">
          <%= render 'layouts/header' %>
          <section class="round">
            <%= yield %>
          </section>
          <%= render 'layouts/footer' %>
        </div>
      </body>
    </html>
    
    Run Code Online (Sandbox Code Playgroud)
  3. app/views/layouts/_stylesheets.html.erb的内容:

    <!--[if lt IE 9]>
    <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <%= …
    Run Code Online (Sandbox Code Playgroud)

ruby-on-rails asset-pipeline

37
推荐指数
1
解决办法
2万
查看次数

标签 统计

asset-pipeline ×1

ruby-on-rails ×1