Compass error: File to import not found or unreadable

Compass error: File to import not found or unreadable

刚刚将 Compass 过滤器添加到我的代码库中。

// This file is main.scss
@import "breakpoint";
@import "compass/css3";
@import "compass/css3/user-interface";
@import "compass/css3/transform";
// Just added filters.
@import "compass/css3/filters";
@import "compass/utilities/general/clearfix";

@import "base/base";
@import "views/views";

现在 Compass 编译任务失败并给出以下错误:

error wp-content/themes/example/styles/main.scss (Line 5: File to import not found or unreadable: compass/css3/filters.
Load paths:
  Compass::SpriteImporter
  /Users/me/example/wp-content/themes/example/styles
  /Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.3/stylesheets
  /Library/Ruby/Gems/2.0.0/gems/sassy-maps-0.4.0/sass
  /Library/Ruby/Gems/2.0.0/gems/breakpoint-2.5.0/stylesheets)
Compilation failed in 1 files.
Warning: ↑ Use --force to continue.

Aborted due to warnings.

我可能在 Compass 设置中遗漏了一个明显的步骤。但是,是的,在添加过滤器之前编译工作正常。

你打错了。正确的语法是:

@import "compass/css3/filter"; // <-- Note 'filter', not 'filters'

参见Compass documentation