Sass是一种css的开发工具,它的安装依赖Ruby,没有安装Ruby的请先安装Ruby。
假定你已经安装了Ruby,则可以直接执行如下语句进行安装。
gem install sass
常见错误提示:
1、ERROR: While executing gem ... (OpenSSL::SSL::SSLError)
hostname "gems.ruby-china.org" does not match the server certificate
解决办法:
执行命令,查看数据源
gem source -l
结果
*** CURRENT SOURCES *** https://ruby.taobao.org/ https://gems.ruby-china.org
则可以删除多余的
gem sources --remove https://ruby.taobao.org/ sudo gem update --system
然后重新安装。
2、ERROR: SSL verification error at depth 1: unable to get local issuer certificate (20)
ERROR: You must add /O=Digital Signature Trust Co./CN=DST Root CA X3 to your local trusted store
Fetching: ffi-1.9.18.gem ( 32%)ERROR: SSL verification error at depth 2: self signed certificate in certificate chain (19)
ERROR: Root certificate is not trusted (/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA)
ERROR: While executing gem ... (OpenSSL::SSL::SSLError)
hostname "gems.ruby-china.org" does not match the server certificate
3、ERROR: SSL verification error at depth 1: unable to get local issuer certificate (20)
ERROR: You must add /O=Digital Signature Trust Co./CN=DST Root CA X3 to your local trusted store
Fetching: ffi-1.9.18.gem (100%)
Building native extensions. This could take a while...
Successfully installed ffi-1.9.18
ERROR: SSL verification error at depth 2: self signed certificate in certificate chain (19)
ERROR: Root certificate is not trusted (/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA)
Fetching: rb-inotify-0.9.10.gem (100%)
Successfully installed rb-inotify-0.9.10
Fetching: sass-listen-4.0.0.gem (100%)
Successfully installed sass-listen-4.0.0
Fetching: sass-3.5.1.gem (100%)
ERROR: While executing gem ... (Errno::EPERM)
Operation not permitted - /usr/bin/sass
遇到以上错误 2和3的解决办法
sudo gem install -n /usr/local/bin sass
查看
sass -v
则会正确显示Sass版本号。
2017年12月28日更新:
Mac更新系统后,Ruby由2.0升级到2.3,再次使用Sass时候,发现报错。
于是决定升级SaaS,重新安装时遇到错误。最后找到解决方案:
先安装libgmp-dev,再重新安装即可。
brew install libgmp-dev sudo gem install -n /usr/local/bin sass
相关推荐
win7 64位系统最新的node.js安装包,和 npm安装sass-loader node-sass win10 win7安装与常见问题解决办法
node-sass安装失败的解决方案.docx
SASS安装的安装文件,以及在安装过程中可能会遇到的需要安装证书
解决方法一:使用淘宝镜像源 设置变量 sass_binary_site,指向淘宝镜像地址。示例: npm i node-sass --sass_binary_site=https://npm.taobao.org/mirrors/node-sass/ // 也可以设置系统环境变量的方式。示
【用于解决 failed Error: not found: python2 node-sass】 报错信息如下: ``` npm WARN prefer global node-gyp@3.6.0 should be installed with -g > node-sass@4.5.2 install E:\workspace_vscode\ww\node...
Sass语言 Sass是一种强大的css扩展语言(css本身并不是一门语言),它允许你使用变量、嵌套规则、mixins、导入等css没有但开发语言(如Java、C#、Ruby等)有的一些特性,并且完全兼容CSS语法。Sass有助于保持大型...
主要介绍了解决node-sass偶尔安装失败的方法小结,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
set SASS_BINARY_PATH=文件路经 例如: set SASS_BINARY_PATH=F:\WorksCode\lib\win32-x64-48_binding.node 查看环境是否合适:echo %SASS_BINARY_PATH% ...最后再来试试安装:npm i -g node-sass
SASS 零基础学习案例以及安装教程,SASS 零基础学习案例以及安装教程
sass 、compassan安装指南
直接下载node-sass和sass-loader下载,然后拷贝到node-modules下即可,再次npm install就不会报错了
主要介绍了整理 node-sass 安装失败的原因及解决办法,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
sass语法官方规范
//sass-node报错的话,使用镜像源cnpm install node-sass sass-loader --save-dev 再安装一次 npm install node-sass --registry=https://registry.npm.taobao.org package.json中更改sass-loader版本 sass-loader:...
A reluctant convert to Sass, Dan Cederholm shares how he came around to the popular CSS pre-processor, and provides a clear-cut path to taking better control of your code (all the while working the ...
3,可以通过淘宝的npm镜像安装node-sass,解决以上问题。 npm install -g cnpm --registry=https://registry.npm.taobao.org (安装淘宝镜像) cnpm install node-sass --save (使用淘宝镜像安装node-sass)
一般的方法是通过gem进行安装,而gem又依赖于Ruby环境,所以要先安装Ruby,然后安装sass和compass,也可以直接使用sass.gem文件进行安装