小编fwa*_*lch的帖子

Ruby on Rails 3.1资产:预编译和图像

我无法让Rails 3.1资产管道预编译在生产模式下工作.它始终在SCSS中引用的图像上失败,并出现如下错误:

$ bundle exec rake assets:precompile RAILS_ENV=production 
  rake aborted!
  rails.png isn't precompiled
    (in /home/florian/AssetTest/app/assets/stylesheets/application.css.scss)
Run Code Online (Sandbox Code Playgroud)

但是当我查看public/assets目录时,图像就在那里,所以它是预编译的:

  $ ls public/assets | grep rails 
    rails-dd352fc2630e5f9aa5685ef1d7fe5997.png
Run Code Online (Sandbox Code Playgroud)

在这种情况下,SCSS文件只包含一些测试代码:

/*
 * This is a manifest file that'll automatically include all the stylesheets available in this directory
 * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
 * the top of the compiled file, but it's generally better to create a new file per style scope.
 *= require_self
 *= …
Run Code Online (Sandbox Code Playgroud)

ruby-on-rails-3.1 asset-pipeline

8
推荐指数
1
解决办法
7803
查看次数

标签 统计

asset-pipeline ×1

ruby-on-rails-3.1 ×1