1.Ruby默認(rèn)源
0. 查看當(dāng)前ruby源:gem sources -l
1. ruby默認(rèn)的源和淘寶的源https://ruby.taobao.org/ 都已經(jīng)不能使用湿颅。我們要移除掉這些不能用的ruby源莉给。
?gem sources --r https://ruby.taobao.org/
2. 使用新的源 https://gems.ruby-china.org/
? gem sources -a https://gems.ruby-china.org/
3. 驗(yàn)證新源是否替換成功
? gem sources -l
如果有其他的地址存在园担,要?jiǎng)h除(gem sources --r)涵妥,最后只留下https://gems.ruby-china.org/
2.安裝cocoapods
sudo gem install -n /usr/local/bin cocoapods? ? //OS X EL Capitan以前系統(tǒng)可以使用sudo gem install cocoapods指令
3.報(bào)錯(cuò)調(diào)整
1.ERROR:? While executing gem … (Gem::DependencyError) Unable to resolve dependencies: cocoapods requires cocoapods-core (= 1.2.0), cocoapods-downloader (< 2.0, >= 1.1.3), cocoapods-trunk (< 2.0, >= 1.1.2), molinillo (~> 0.5.5), xcodeproj (< 2.0, >= 1.4.1); activesupport requires thread_safe (>= 0.3.4, ~> 0.3); tzinfo requires thread_safe (~> 0.1)
解決辦法:gem update --system
2.ruby源已經(jīng)確認(rèn)沒(méi)問(wèn)題澎嚣,但是還是會(huì)報(bào)一個(gè)地址的錯(cuò)誤击吱。While executing gem…(OpenSSL::SSL::SSLError)hostname“upyun.gems.ruby-china.org”doesnotmatch the server certificate
解決辦法:gem sources --remove 報(bào)錯(cuò)的http地址upyun.gems.ruby-china.org
3.ERROR: While executing gem ... (Errno::EPERM) Operation not permitted - /usr/bin/pod
解決辦法:蘋(píng)果系統(tǒng)升級(jí)OS X EL Capitan后會(huì)出現(xiàn)的插件錯(cuò)誤淋淀,將安裝指令 sudo gem install cocoapods ——>改為sudo gem install -n /usr/local/bin cocoapods