3:sass的安裝

首先安裝ruby

ruby版本檢查:ruby -v

gem版本檢查:gem -v

gem相似於node裏面的npm,是ruby的安裝包管理器,利用gem來安裝sass

sass安裝

gem install sass

sass 測試版安裝

gem install sass --pre

sass卸載

gem uninstall sass

sass更新

gem update sass

sass版本查看

sass -v

sass幫助

sass -h

因爲衆所周知的緣由,咱們可能安裝不成功,這時候咱們能夠利用淘寶RubyGems鏡像來安裝sass

第一步:檢查默認的源:gem sources l

返回結果:node

*** CURRENT SOURCES ***

https://rubygems.org/

第二步:移除默認的源:gem sources --remove https://rubygems.org/

返回結果:npm

https://rubygems.org/ removed from sources

第三步:檢查默認的源:gem sources l

返回結果:sass

*** CURRENT SOURCES ***

第四步:添加淘寶的源:gem sources -a https://ruby.taobao.org/

返回結果:ruby

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

分析:好像該地址是缺乏gem,更換淘寶的源地址:改成:http://gems.ruby-china.org/測試

第五步:添加淘寶的源:gem sources -a http://gems.ruby-china.org/

返回結果:fetch

http://gems.ruby-china.org/ added to sources

第五步:檢查默認的源:gem sources l

返回結果:code

*** CURRENT SOURCES ***

http://gems.ruby-china.org/

第六步:安裝sass,gem install sass

返回結果:server

Fetching: sass-3.4.22.gem (100%)
Successfully installed sass-3.4.22
Parsing documentation for sass-3.4.22
Installing ri documentation for sass-3.4.22
Done installing documentation for sass after 7 seconds
1 gem installed

第七步:檢查sass:sass -v

返回結果:rem

Sass 3.4.22 (Selective Steve)

最後在執行一遍:gem sources -a https://rubygems.org/;把默認的源在添加進去get

相關文章
相關標籤/搜索