0
votes

I'm trying to start using compass to manage sprites in my Rails project. Following the "Basic Usage" section of the Compass sprites tutorial, I created sprites.css.scss in my stylesheets directory, with the following lines:

@import "compass/utilities/sprites";
@import "sprite_icons/*.png";
@include all-sprite_icons-sprites;

I also created a directory "sprite_icons" under app/assets/images, and dumped a couple of png files there. When I try to load a page in my rails app, I get this message:

File to import not found or unreadable: compass/utilities/sprites

I decided that maybe the compass-rails gem I installed makes that import unnecessary, so I tried removing it, but then I get this error:

File to import not found or unreadable: sprite_icons/*.png. Load paths: /[...]/app/assets/images

I checked permissions on the new directory and they are readable. It looks like it has the right load path to find my sprite_icons directory.

Any suggestions?

1

1 Answers

1
votes

It turns out I hadn't done anything to tell Rails about the existence of sass-rails or compass-rails. So, I needed to add the following to (a file required by) config/application.rb:

require 'sass-rails'
require 'compass-rails'

and now the sprites are generated.