Is Sass 3.3 compatible with Compass?

2019-01-02 21:27发布

I have just upgraded to Sass 3.3 so that I can use some of the new features (BEM styled class names, mappings, @at-root, etc). If I compile my project with Sass (via sass --watch), it works just fine. However, if I compile it using Compass (via compass watch), I get an error when using the new Sass features.

I'm using Compass 0.12.

3条回答
回忆,回不去的记忆
2楼-- · 2019-01-02 21:46

Compass 0.12 explicitly depends on Sass 3.2. Even if you have a newer version of Sass installed, it will still compile with 3.2. In order to use Sass 3.3 or later, you have to be using Compass 1.0 or later.

Running the gem install command normally should get you the latest stable version.

gem install compass

At the time this question was asked, Compass 1.0 was still in beta. To install the latest beta version of a gem, you will need to install it using the --pre flag.

gem install compass --pre

Note that you do not need to install Sass first in order for this to work. Installing Compass will automatically install the latest version of Sass that it is compatible with.

I have Compass 1.0 installed and it still errors

  • Double check any other dependencies you might have (Compass extensions, etc.), one of them might be specifying an older version of Sass or Compass.
  • If you're using an application or build tool rather than using the commands directly, make sure they're not referencing older versions of Compass.

Windows users

As a Window user, I got an error when I tried to watch my project using the newer Compass.

LoadError on line ["36"] of C: cannot load such file -- wdm"

To fix that problem:

You must install the ruby DevKit: Download found here: http://rubyinstaller.org/downloads/

Follow this page to properly install: https://github.com/oneclick/rubyinstaller/wiki/Development-Kit

Now install wdm:

gem install wdm
查看更多
只靠听说
3楼-- · 2019-01-02 21:47

It now is, in the latest version of Compass. Update compass to get the changes and work with Sass 3.3 and higher

Current Sass compatibility can be found here: https://rubygems.org/gems/compass

To upgrade just run

$gem install compass
查看更多
人气声优
4楼-- · 2019-01-02 21:51

There didn't seem to be any one place that contained the whole list of steps required, in order, to make this work, so here they are. This list is for Windows, but it may work fine on other platforms.

  1. Install Ruby -- use 1.9.3 -- http://rubyinstaller.org/downloads .

  2. Download the Ruby DevKit found lower on the same page -- http://rubyinstaller.org/downloads/ run it to extract it somewhere (permanent). Then cd to it, run “ruby dk.rb init” and “ruby dk.rb install” to bind it to ruby installations in your path.

  3. gem install wdm

  4. gem install sass

  5. gem install compass --pre

查看更多
登录 后发表回答