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

10,895

Solution 1

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

Solution 2

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

Solution 3

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 :)

Share:
10,895

Related videos on Youtube

matthew
Author by

matthew

Updated on June 04, 2022

Comments

  • matthew
    matthew almost 2 years

    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?

    • Timo
      Timo almost 11 years
      I noticed that some of the alpha builds are not working with compass. Sass 3.3.0.alpha.149 does however work, at least on my setup.