mac安装sass 遇到gem镜像问题:
因为mac 自带ruby
输入ruby -v
输出: ruby 2.3.1
所以我直接运行如下命令:
gem install sass
但是出现如下的错误:
While executing gem ... (Gem::FilePermissionError)
You don‘t have write permissions for the /var/lib/gems/2.1.0 directory.
按照字面意思应该就是权限问题了,于是我又进行下面的命令:
sudo gem install sass
然后又出现如下的错误:
While executing gem ... (Gem::RemoteFetcher::FetchError)
Errno::ECONNRESET: Connection reset by peer - SSL_connect (https://api.rubygems.org/gems/sass-3.4.18.gem)
百度之后,说是gem 在国内的镜像不能用,庆幸淘宝改了其镜像,步骤如下:
$ gem sources --remove https://rubygems.org/
$ gem sources -a https://ruby.taobao.org/
$ gem sources -l
CURRENT SOURCES
按照步骤进行就行,之后再进行如下命令:
sudo gem install sass
完美解决此问题!