【问题标题】:Rails @import compass not found未找到 Rails @import 指南针
【发布时间】:2012-05-16 20:32:47
【问题描述】:

这是我的 application.css:

/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
 * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
 *
 * 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
 *= require_tree .
*/

@import "compass/reset";

在指南针重置时获得 404:

GET http://0.0.0.0:3000/assets/compass/reset 404 (Not Found)

顺便说一句,运行 Rails 3.2.3。谢谢!

【问题讨论】:

  • 您是否在 Gemfile 中包含了 compass gem?
  • 我从来没有在清单文件本身中添加东西。您是否尝试过将 @import 语句移动到树中的其他文件?
  • 我没有尝试移动它,但我会的。我不明白的是,实际的指南针文件在哪里?如果我知道他们在哪里,我想我最好能够将它们包含在我的项目中。
  • 实际文件在 compass-rails gem 中。这表明您还需要 'compass-rails' gem,而不仅仅是 'compass' gem。
  • 添加 'compass-rails' 不起作用。

标签: ruby-on-rails ruby-on-rails-3 asset-pipeline compass-sass


【解决方案1】:

application.css 重命名为application.css.scss

【讨论】:

  • 别忘了重启网络服务器。
  • 删除链轮require 指令也是一个好主意(即删除application.css 文件中的所有*= require something
猜你喜欢
  • 2013-03-13
  • 1970-01-01
  • 2013-09-10
  • 2010-12-30
  • 1970-01-01
  • 2011-09-07
  • 1970-01-01
  • 1970-01-01
  • 2017-01-24
相关资源
最近更新 更多