SASS/compass path in config.rb causing problem on compile

When I compile my SCSS, I'm getting a "file not found" error that leads me to believe there is something wrong with my config.rb. The error from the command line includes part of the path twice as well as the ".." relative directory:

File not found or cannot be read: C:/REALLY_LONG_PATH/C:/REALLY_LONG_PATH/../img/avatar.jpg

The config.rb reads as follows:

# Delineate the directory for our SASS/SCSS files (this directory)
sass_path = File.dirname(__FILE__)

# Delineate the CSS directory (under resources/css in this demo)
css_path = File.join(sass_path, "..", "css")

# Delinate the images directory
images_dir = File.join(sass_path, "..", "img")

# Load the sencha-touch framework
load File.join(sass_path, '..', 'js', 'sencha', 'resources', 'themes')

# Specify the output style/environment
output_style = :expanded
environment = :production

This error is not present if I omit the CSS that references it in the SCSS file:

background-image: inline-image('avatar.jpg');

But considering the fact that I'd like to actually use the image, this creates a problem for me. Any help would be gravy.

EDIT: Another thing worth noting is the fact that my CSS seems to render just fine in the appropriate directory using the identical format as the that of the img path.


The workaround at this point is to use straight url('image.jpg') calls, but eventually inline-image('image.jpg') will need to be used for optimization. (Which is beyond the scope of this thread, so I'm counting this as answered, unless someone has a better explanation.)

UPDATE

Better answer: Trust the error and actually include the file(s) it says it needs. What threw me before was that the path name looked way wrong, but it was likely due to my own improper concatenation of the path. Also, don't be thrown by the " .. " in the middle of the resulting path. It just means "move up a dir" and is, of course still legal.

链接地址: http://www.djcxy.com/p/91660.html

上一篇: Sass / Compass可以编译到很多地方

下一篇: config.rb中的SASS / compass路径导致编译时出现问题