gruntjs / grunt-contrib-compass

Compile Compass to CSS.
http://gruntjs.com/
MIT License
625 stars 128 forks source link

Compass v1.0.1 and sprites #197

Closed valeriansaliou closed 8 years ago

valeriansaliou commented 10 years ago

Hello,

Seems to be a critical issue since it prevents compilation of SASS to CSS files.

Since I upgraded Compass to v1.0.1, I'm encountering issues with sprite generation path. I didn't change my Gruntfile.js compass configuration (didn't touch the image paths, especially).

The sprites are successfully generated and stored in the right place. This is only while using them in the compiled SASS to CSS files that the paths are wrongly generated (it's a real MESS, actually).

I'm currently testing how it's going with a standard config.rb file in place of passing paths directly to the Gruntfile.js.

Here's the error output I'm getting:

Running "compass:compile" (compass) task
directory tmp/stylesheets
   create build/images/button_desktop-s6bdf143c3c.png
    error src/stylesheets/button_desktop.sass (/usr/local/lib/ruby/gems/2.1.0/gems/compass-core-1.0.1/lib/compass/core/sass_extensions/functions/image_size.rb:31:in `initialize': No such file or directory @ rb_sysopen - /Users/valerian/Documents/Web/plugins.singulia.com/groupchat/src/images/../../build/images//Users/valerian/Documents/Web/plugins.singulia.com/groupchat/build/images/button_desktop-s6bdf143c3c.png)
   create build/images/button_mobile-s3dcf17a86e.png
    error src/stylesheets/button_mobile.sass (/usr/local/lib/ruby/gems/2.1.0/gems/compass-core-1.0.1/lib/compass/core/sass_extensions/functions/image_size.rb:31:in `initialize': No such file or directory @ rb_sysopen - /Users/valerian/Documents/Web/plugins.singulia.com/groupchat/src/images/../../build/images//Users/valerian/Documents/Web/plugins.singulia.com/groupchat/build/images/button_mobile-s3dcf17a86e.png)
    write tmp/stylesheets/groupchat.css (1.607s)
   create build/images/interface_desktop-s182da905f2.png
    error src/stylesheets/interface_desktop.sass (/usr/local/lib/ruby/gems/2.1.0/gems/compass-core-1.0.1/lib/compass/core/sass_extensions/functions/image_size.rb:31:in `initialize': No such file or directory @ rb_sysopen - /Users/valerian/Documents/Web/plugins.singulia.com/groupchat/src/images/../../build/images//Users/valerian/Documents/Web/plugins.singulia.com/groupchat/build/images/interface_desktop-s182da905f2.png)
   create build/images/interface_mobile-sa43bcbfcb5.png
    error src/stylesheets/interface_mobile.sass (/usr/local/lib/ruby/gems/2.1.0/gems/compass-core-1.0.1/lib/compass/core/sass_extensions/functions/image_size.rb:31:in `initialize': No such file or directory @ rb_sysopen - /Users/valerian/Documents/Web/plugins.singulia.com/groupchat/src/images/../../build/images//Users/valerian/Documents/Web/plugins.singulia.com/groupchat/build/images/interface_mobile-sa43bcbfcb5.png)
Compilation failed in 4 files.
Warning: ↑ Use --force to continue.

Aborted due to warnings.

My Gruntfile.js configuration (seems that everything is okay with the paths being passed to compass, since if I change the image path, it's reflected in the error output):

var CONF_COMPASS_OPTIONS = {
  imagesDir: 'src/images',
  generatedImagesDir: 'build/images',
  httpGeneratedImagesPath: '../images',
  sassDir: 'src/stylesheets',
  cssDir: 'tmp/stylesheets',
  fontsDir: 'src/fonts',
  httpFontsPath: '../fonts',
  httpFontsDir: 'build/fonts',
  environment: 'development'
};
valeriansaliou commented 10 years ago

Similar issue when using config.rb instead:

Running "compass:compile" (compass) task
directory tmp/stylesheets
   create ./build/images/button_desktop-s6bdf143c3c.png
    error src/stylesheets/button_desktop.sass (/usr/local/lib/ruby/gems/2.1.0/gems/compass-core-1.0.1/lib/compass/core/sass_extensions/functions/image_size.rb:31:in `initialize': No such file or directory @ rb_sysopen - ./src/images/../../build/images/./build/images/button_desktop-s6bdf143c3c.png)
   create ./build/images/button_mobile-s3dcf17a86e.png
    error src/stylesheets/button_mobile.sass (/usr/local/lib/ruby/gems/2.1.0/gems/compass-core-1.0.1/lib/compass/core/sass_extensions/functions/image_size.rb:31:in `initialize': No such file or directory @ rb_sysopen - ./src/images/../../build/images/./build/images/button_mobile-s3dcf17a86e.png)
    write tmp/stylesheets/groupchat.css (1.407s)
   create ./build/images/interface_desktop-s182da905f2.png
    error src/stylesheets/interface_desktop.sass (/usr/local/lib/ruby/gems/2.1.0/gems/compass-core-1.0.1/lib/compass/core/sass_extensions/functions/image_size.rb:31:in `initialize': No such file or directory @ rb_sysopen - ./src/images/../../build/images/./build/images/interface_desktop-s182da905f2.png)
   create ./build/images/interface_mobile-sa43bcbfcb5.png
    error src/stylesheets/interface_mobile.sass (/usr/local/lib/ruby/gems/2.1.0/gems/compass-core-1.0.1/lib/compass/core/sass_extensions/functions/image_size.rb:31:in `initialize': No such file or directory @ rb_sysopen - ./src/images/../../build/images/./build/images/interface_mobile-sa43bcbfcb5.png)
Compilation failed in 4 files.
Warning: ↑ Use --force to continue.

Aborted due to warnings.