Sass 3.3与Compass兼容吗? [英] Is Sass 3.3 compatible with Compass?

查看:71
本文介绍了Sass 3.3与Compass兼容吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚升级到Sass 3.3,以便可以使用一些新功能(BEM样式的类名,映射,@ at-root等)。如果我用Sass编译项目(通过 sass --watch ),则可以正常工作。但是,如果我使用Compass编译(通过 compass watch ),则在使用新的Sass功能时会出错。

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.

我正在使用Compass 0.12。

I'm using Compass 0.12.

推荐答案

指南针0.12明确依赖于Sass 3.2。即使您安装了较新版本的Sass,它仍将使用3.2进行编译。为了使用Sass 3.3或更高版本,您必须使用Compass 1.0或更高版本。

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.

运行gem install命令通常应该会为您提供最新的稳定版本。

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

gem install compass

在提出此问题时,指南针1.0仍处于测试阶段。要安装最新的beta版gem,您需要使用-pre 标志进行安装。

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

请注意,不要需要先安装Sass才能使其正常工作。安装Compass会自动安装与之兼容的最新版本的Sass。

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.


  • 再次检查您可能具有的其他任何依赖项(指南针扩展名等),其中之一可能是指定了较旧版本的Sass或Compass。 / li>
  • 如果您使用的是应用程序或构建工具,而不是直接使用命令,请确保它们没有引用旧版本的Compass。

作为Window用户,尝试使用较新的Compass观看项目时出现错误。

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


C线[ 36]的LoadError:无法加载该文件-wdm

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

要解决该问题:

您必须安装ruby DevKit:
在此处下载:< a href = http://rubyinstaller.org/downloads/ rel = nofollow> http://rubyinstaller.org/downloads/

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

请按照以下页面正确安装:
https://github.com/oneclick/ rubyinstaller / wiki / Development-Kit

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

现在安装wdm:

gem install wdm

这篇关于Sass 3.3与Compass兼容吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆