一、RubyGems
RubyGems是什么
RubyGems簡稱gem犀忱,是一個對Ruby組建進(jìn)行打包的Ruby打包系統(tǒng)得院。
gem怎么升級(更新)
sudo gem update --system
Mac OSX 10.11之后會報錯左电,用下面命令:
sudo gem update -n /usr/local/bin —system
二牌废、CocoaPods
CocoaPods是什么
http://www.reibang.com/p/b64b4fd08d3c
三咽白、安裝CocoaPods
安裝
1、更新gem
2鸟缕、查看Ruby的源
gem source -l
終端中:
https://gems.ruby-china.org/
https://ruby.taobao.org/
如果有淘寶的源晶框,需要刪除,因為taobao Gems源已停止維護(hù)懂从,現(xiàn)由 ruby-china 提供鏡像服務(wù)授段。
gem sources --remove https://ruby.taobao.org/
4番甩、設(shè)置ruby-china為Ruby的源
gem sources -a https://gems.ruby-china.org/
5侵贵、安裝CocoaPods
sudo gem install -n /usr/local/bin cocoapods
pod setup
Mac OSX 10.11之前,用下面命令:
sudo gem install cocoapods
報錯處理
如果報錯
ERROR: SSL verification error at depth 2: self signed certificate in certificate chain (19)
ERROR: Root certificate is not trusted (/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA)
ERROR: SSL verification error at depth 2: self signed certificate in certificate chain (19)
ERROR: Root certificate is not trusted (/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA)
ERROR: While executing gem ... (OpenSSL::SSL::SSLError)
hostname "gems.ruby-china.org" does not match the server certificate
用如下操作:
sudo gem install -n /usr/local/bin cocoapods
pod setup
http://www.reibang.com/p/39782ea3bb61
http://www.reibang.com/p/8b61b421dd76
http://www.reibang.com/p/a94c8a80fb4c
http://www.reibang.com/p/b5e5cd053464
http://www.reibang.com/p/b64b4fd08d3c