1.安装ruby 官网下载ruby,点击exe安装包安装
2.命令安装sass
点击安装好的ruby环境命令框,进行安装sass
gem install sass
3.常见错误
(1) gem安装sass 报错:Could not find a valid gem 'sass' (>= 0), here is why:
解决:切换镜像源 gem sources -a http://ruby.taobao.org/
(2) 切换镜像源失败 Error fetching https://ruby.taobao.org/:
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: ce
rtificate verify failed (https://ruby.taobao.org/specs.4.8.gz)
解决:
删除原gem源: gem sources --remove https://rubygems.org/
添加国内源: gem sources -a http://gems.ruby-china.org/
-------------------------------补充-------------------------------------
在Mac中切换的时候不管是使用http还是https,都无效,还是安装不了
一直报错
Error fetching http://gems.ruby-china.org/:
bad response Not Found 404 (https://gems.ruby-china.org/specs.4.8.gz)
后来 执行了: sudo gem update --system
然后。gem sources -a https://gems.ruby-china.com/
成功了。记录一下
------------------------------------------------------------------------
打印是否替换成功: gem sources -l
更换成功后打印如下: http://gems.ruby-china.org/
切换成功之后:直接 gem install sass