sass_安装问题(ERROR: Could not find a valid gem 'sass' (>= 0), here is why: Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: cert)

安装sass前需安装ruby

安装好ruby好打开命令行,输入

 

1 gem install sass

 

出现错误:

1 ERROR: Could not find a valid gem 'sass' (>= 0), here is why:
2 Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://api.rubygems.org/specs.4.8.gz)

网上的解决方案是换成国内镜像https://ruby.taobao.org
代码:

1 gem sources --add https://ruby.taobao.org

然而试了一下发现还是报错:

1 Error fetching https://ruby.taobao.org/:
2 SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://rubygems-china.oss-cn-hangzhou.aliyuncs.com/specs.4.8.gz)

stackoverflow上搜索了一番,发现可以这样:

1 gem sources --add http://rubygems.org

会提示:

1 https://rubygems.org is recommended for security over http://rubygems.org/

忽略,现在再试试gem install sass, 成功:

1 Fetching: sass-3.4.22.gem (100%)
2 Successfully installed sass-3.4.22
3 Parsing documentation for sass-3.4.22
4 Installing ri documentation for sass-3.4.22
5 Done installing documentation for sass after 18 seconds
6 1 gem installed

 

原文链接:https://www.jianshu.com/p/968697eb42eb

 

posted @ 2018-06-19 10:41  幽谷兰花  阅读(738)  评论(0编辑  收藏  举报