Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sass --compass --watch Error: Cannot load compass

I am working with sass and compass and trying to use the new sourcemap feature as Chrome 27 requires the new method of sourcemap to show the actual sass files and line numbers in the chrome console panel.

I am able to run the following sass command sass --sourcemap --watch style.scss:style.css

however if I append the --compass argument like the following sass --compass --sourcemap --watch style.scss:style.css

I get the following error in the windows cmd panel: "ERROR: Cannot load compass".

I have tried following some of methods that apparently worked for some people on the github issue page https://github.com/chriseppstein/compass/issues/1108

The methods I have tried are using the sass 3.3.0.alpha.177 with compass 0.12.2 (this producers an error every time I try and execute the compass gem which is almost identical to this issue Why does "compass watch" say it cannot load sass/script/node (LoadError)?)

Currently my setup is the following:

  • sass 3.3.0.alpha.177
  • compass 0.13.alpha.4
  • Windows 7

Is there a way that I can use Sass with compass and at the same time generate the sourcemaps which are needed for css debugging?

like image 313
matthew Avatar asked Jun 11 '13 07:06

matthew


Video Answer


3 Answers

The versions mentioned by @lollerskates666 work, but I had to specifically remove sass version 3.3.4 which came down when I installed compass.

If anyone else if having this difficulty, I had to run the following rules to get it working:

gem install compass --version 0.12.2

This installs compass and also Sass 3.3.4 (Maptastic Maple). These two versions, combined with --sourcemap don't seem to play nicely, so you'll need to install an older version of Sass:

gem install sass --pre --version 3.3.0.alpha.149

Although you've now installed it, if you run:

sass --v 

Ruby will still be using Sass version 3.3.4, so you'll need to uninstall this version:

gem uninstall sass
**Select number assigned to version 3.3.4**

Now, if you run:

sass --v

You should see:

Sass 3.3.0.alpha.149 (Bleeding Edge)

Sass should now work with the compass lib and also produce sourcemaps, which Chrome can read :)

I run this command to watch my scss files:

sass --watch --sourcemap --compass --style compressed scss:css

Hope this helps!!

** I'm running this on a Mac, but the same versions work fine :)

like image 106
penguinflip Avatar answered Sep 27 '22 19:09

penguinflip


I found that I had two versions of Sass installed (3.4.25 and 3.5.5). I was getting the error when using grunt which was using the latest version 3.5.5. I resolved the problem by uninstalling 3.5.5.

gem uninstall sass

Select gem to uninstall:
 1. sass-3.4.25
 2. sass-3.5.5
 3. All versions
like image 28
Danny Thompson Avatar answered Sep 27 '22 19:09

Danny Thompson


Works with Sass 3.3.0.alpha.149 and compass 0.12.2 on windows 7

like image 27
matthew Avatar answered Sep 27 '22 20:09

matthew