3

我的指南针项目目录结构如下

s3z@s3z:~/Desktop/compass_project$ tree
.
├── basic.html
├── config.rb
├── css
│   ├── ie.css
│   ├── print.css
│   └── screen.css
├── index.html
├── partials
│   └── _normalize.scss
└── sass
    ├── ie.scss
    ├── print.scss
    └── screen.scss

我的 screen.scss 文件看起来像这样

@import "compass";
@import "partials/normalize";   

当我添加@import "partials/normalize";并保存它时,指南针向我吐出以下错误

>>> Compass is watching for changes. Press Ctrl-C to Stop.
>>> Change detected at 22:58:53 to: screen.scss
    error sass/screen.scss (Line 2: File to import not found or unreadable: partials/normalize.
Load paths:
  /home/max/Desktop/nettut_compass_tut/sass
  /home/max/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/frameworks/blueprint/stylesheets
  /home/max/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/frameworks/compass/stylesheets
  Compass::SpriteImporter)
overwrite ./css/screen.css 

以防万一我的事情很config.rb重要

http_path = "/"
css_dir = "css"
sass_dir = "sass"
images_dir = "images"
javascripts_dir = "javascripts"

有想法该怎么解决这个吗?

4

1 回答 1

6

你已经定义了你sass_dirsass指南针正在寻找那个重置文件:sass/partials/normalize如果你想在你sass_dir的 .

@import "../partials/normalize";

就个人而言,我更喜欢将部分目录放在 sass 目录中,或者只是让它们排序到顶部松散。

于 2013-01-17T23:23:14.953 回答