按官方教程,这样就行了:
$ gem sources --remove https://rubygems.org/
$ gem sources -a https://ruby.taobao.org/ 之后执行:gem install sass
但有时会报错:
Error fetching https://ruby.taobao.org/: 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)
这里有个解决办法:直接修改本地配置文件
找到.gemrc文件,一般是C盘
---:backtrace: false:bulk_threshold: 1000:sources:- <strong>https://ruby.taobao.org/</strong>:update_sources: true:verbose: true 黑体那里可以直接修改,注意前面有个空格
然而有时候还是不行:
ERROR: Could not find a valid gem 'sass' (>= 0), here is why: Unable to download data from https://gems.ruby-china.org/ - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://gems.ruby-china.org/specs.4.8.gz)
有一种解决方式:
切换源,不用淘宝的了,用基于腾讯云的:http://gems.ruby-china.org/
这里注意是http,不是https
完成
|