0
votes

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.

1
Why do you have a REALLY LONG PATH name(s)? - Jared Farrish
Just shortening for sake of the illustration. That's not some path variable or something. Thanks for checking. - Old McStopher
I wonder if this is a Windows/Ruby thing... If you understand how the paths are working, could you try using absolute paths instead of relative? - David Kaneda
Yeah, it doesn't hurt, considering only the compiled CSS goes live. I may try that when I get back around to optimizations and need to do inline images. - Old McStopher

1 Answers

1
votes

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.