3.16 解決辦法
使用SSH
配置github SSH
git config --global user.email "zhenghan1221@163.com"
創(chuàng)建公鑰密鑰箭昵,保存路徑默認(rèn)锨并,直接按Enter鍵乓诽,輸入密碼同樣Enter鍵
ssh-keygen -t rsa -C "zhenghan1221@163.com"
前往文件夾 /用戶/qiyong/.ssh,找到id_rsa.pub文件,使用文本編輯打開(kāi)后秦踪,全選復(fù)制照卦,然后登陸GitHub賬戶,在設(shè)置中找到SSH和GPG密鑰捺檬,選擇New SSH Key新建密鑰,將復(fù)制的內(nèi)容粘貼進(jìn)去贸铜,Add創(chuàng)建成功堡纬。
在終端中下載
cd ~/.cocoapods/repos git clone git@github.com:Cocoapods/Specs.git master
然后執(zhí)行命令
rm ~/Library/Caches/CocoaPods/search_index.json
再pod search 就可以了。
pod 更新和安裝采用以下命令
pod install --verbose --no-repo-update pod update --verbose --no-repo-update
轉(zhuǎn)為SSH蒿秦,其實(shí)和直接使用http,或者下載好資源再拷貝到~/.cocoapods/repos目錄下的解決辦法烤镐,并沒(méi)有什么區(qū)別。
注意:可使用命令查看當(dāng)前的請(qǐng)求方式
git remote -v
3.8號(hào)的時(shí)候棍鳖,好多app 因使用熱修復(fù)而收到警告炮叶,盡管我還沒(méi)有收到郵件警告,但這個(gè)問(wèn)題既然那么多人遇到了渡处,咱還是及時(shí)把Hotfix清除掉吧镜悉,于是由此引發(fā)了一系列問(wèn)題。在此以作記錄医瘫,方便以后查閱侣肄。3.15仍無(wú)法解決SSL證書(shū)問(wèn)題,于是以http替代https
qimatoMacBook-Pro:~ qiyong$ gem sources -l *** CURRENT SOURCES ***https://gems.ruby-china.org qimatoMacBook-Pro:~ qiyong$ gem sources --add http://gems.ruby-china.org/ --remove https://gems.ruby-china.org http://gems.ruby-china.org/ added to sourceshttps://gems.ruby-china.org removed from sources qimatoMacBook-Pro:~ qiyong$ gem sources -l *** CURRENT SOURCES *** http://gems.ruby-china.org/ qimatoMacBook-Pro:~ qiyong$ sudo gem install -n /usr/local/bin cocoapods qimatoMacBook-Pro:~ qiyong$ pod setup
3.15 以下嘗試均失敶挤荨稼锅!首先是pod update 失敗吼具,于是我就去更新pod ,然后在pod setup時(shí)遭遇一下錯(cuò)誤:
fatal: unable to access 'https://github.com/CocoaPods/Specs.git/': Server aborted the SSL handshake[!] CocoaPods was not able to update the
master
repo. If this is an unexpected issue and persists you can inspect it runningpod repo update --verbose
rvm升級(jí)
在這一過(guò)程中我也走了彎路,沒(méi)能準(zhǔn)確的找到問(wèn)題的根源所在矩距,于是查看了下ruby的最新環(huán)境2.3.0 當(dāng)時(shí)我的rvm是1.27的版本拗盒,于是我直接去更新ruby,遭遇錯(cuò)誤:
于是剩晴,對(duì)rvm進(jìn)行升級(jí)锣咒,
\curl -sSL https://get.rvm.io | bash -s stable
$curl -L get.rvm.io | bash -s stable
載入rvm 環(huán)境
$source ~/.rvm/scripts/rvm
或者在當(dāng)前的窗口中繼續(xù)輸入
$rvm update
然后查看rvm的版本就可知道是否真的安裝成功
$rvm -v
使用rvm對(duì)ruby進(jìn)行升級(jí)
查看ruby的最新版本$rvm list known
安裝rubyrvm install 2.4.0
設(shè)置默認(rèn)版本,可以用這條命令來(lái)完成$ rvm use 2.4.0 --default
查看已安裝的ruby$ rvm list
卸載一個(gè)已安裝ruby版本$ rvm remove 2.4.0
在這一過(guò)程中赞弥,rvm install 2.4.0時(shí)遇到上面圖片所展示的問(wèn)題二毅整,這時(shí)我再次查看,注意到了這樣的描述:
Error: /opt/local/bin/port: Failed to initialize MacPorts, OS platform mismatch
問(wèn)題來(lái)了:macPorts的問(wèn)題如何解決绽左?
打開(kāi)鏈接:https://www.macports.org/install.php ,選擇當(dāng)前系統(tǒng)對(duì)應(yīng)的macports即可悼嫉,下載完成后點(diǎn)擊安裝。
之后再打開(kāi)終端新窗口拼窥,執(zhí)行ruby的升級(jí)命令即可戏蔑。ruby升級(jí)之后,我再次對(duì)pod升級(jí)鲁纠,問(wèn)題依舊:
fatal: unable to access 'https://github.com/CocoaPods/Specs.git/': SSLRead() return error -9806[!] /usr/bin/git clone https://github.com/CocoaPods/Specs.git master --progressCloning into 'master'...fatal: unable to access 'https://github.com/CocoaPods/Specs.git/': SSLRead() return error -9806
這個(gè)時(shí)候我才意識(shí)到問(wèn)題的根本所在总棵,原來(lái)是SSLread的錯(cuò)誤
查閱資料說(shuō)是SecureTransport后端使用的curl。
資料中使用到了以下命令:
$ brew remove git $ brew remove curl $ brew install openssl $ brew install --with-openssl curl $ brew install --with-brewed-curl --with-brewed-openssl git
我在終端中輸入了一下brew list改含,告訴我該命令不可用情龄,原來(lái)我的電腦并沒(méi)有安裝Homebrew
Homebrew安裝
命令如下
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
在這一過(guò)程中遇到如下問(wèn)題描述:
于是我將github的HTTPS轉(zhuǎn)為SSH
在Terminal中輸入以下命令即可$git remote set-url origin git@github.com:USERNAME/OTHERREPOSITORY.git
完成之后打開(kāi)新窗口再次安裝brew,
這次成功了,之后就是執(zhí)行brew install openssl
完成后繼續(xù)執(zhí)行brew install --with-openssl curl
最后再次執(zhí)行命令brew install --with-brewed-curl --with-brewed-openssl git
至此捍壤,打開(kāi)新窗口骤视,再次pod setup就成功了。
個(gè)人猜測(cè)鹃觉,不知道是否將github的HTTPS轉(zhuǎn)為SSH专酗,即可pod setup成功,當(dāng)時(shí)沒(méi)有想到這點(diǎn)去嘗試一下盗扇。
rvm pkg install openssl2.rvm install 2.3.0 --with-openssl-dir=/Users/milai/.rvm/usr (加粗的代表 第一步安裝openssl的文件目錄)
3.14全部卸載祷肯,從頭開(kāi)始,使用brew安裝了openssl后疗隶,繼續(xù)使用brew安裝ruby 躬柬,依然失敗 此時(shí)系統(tǒng)中的ruby 仍為2.0.0,我想應(yīng)該是缺失了將brew安裝的ruby拷貝到系統(tǒng)中去抽减。
此方式失敗。
而后重裝rvm 安裝ruby采用的以下方式:
此方式仍舊失敗橄碾。
官網(wǎng)中說(shuō)參考這個(gè)鏈接中
(https://github.com/huacnlee/init.d/blob/master/install_rvm)
的方式 正確安裝gem/ruby卵沉,但我不知道究竟是哪一步出錯(cuò)颠锉。
看過(guò)了這篇文章
http://www.reibang.com/p/b64b4fd08d3c
很多人說(shuō)他們的問(wèn)題解決了,但我一開(kāi)始就是正確的安裝姿勢(shì)史汗,16年琼掠,包括17年2月份更新時(shí)都是可以的,沒(méi)問(wèn)題的停撞,3月10號(hào)時(shí)再次更新瓷蛙,就出錯(cuò)了。SSL問(wèn)題到現(xiàn)在也沒(méi)找到正確的解鎖姿勢(shì)戈毒。
另有解決辦法艰猬,起初有嘗試過(guò),亦然失敗埋市。
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
這是兩篇關(guān)于解決ruby的openSSL問(wèn)題的文章:
https://ruby-china.org/topics/28575
http://www.reibang.com/p/dc0b99226b83
嘗試過(guò)冠桃,在make這一步出現(xiàn)問(wèn)題。
解壓:tar -xzvf ruby-2.4.0.tar.gz
參考鏈接:
1.ruby更新: http://charsdavy.github.io/2016/09/03/mac-ruby-update/
2.輕松幾步搞定CocoaPods修復(fù)10.11不能安裝問(wèn)題http://www.reibang.com/p/9fd6d9ddf4ca3.Mac
3.升級(jí)到10.11 出現(xiàn)的問(wèn)題和解決方法
http://www.reibang.com/p/02b74ad2787c
4.http://stackoverflow.com/questions/39434447/unable-to-setup-pods-error-rpc-failed-curl-56-sslread-return-error-9806
5.在SSH和HTTPS之間切換https://help.github.com/articles/changing-a-remote-s-url/
6.http://blog.sina.com.cn/s/blog_bb5a48430102w9j3.html
7.Homebrew安裝 https://brew.sh/index_zh-cn.html
8.http://www.reibang.com/p/dc0b99226b83
9.CocoaPods 的簡(jiǎn)單快速安裝方法