1.error:RPC failed; curl 56 LibreSSL SSL_read:SSL_ERROR_SYSCALL,errno 54
error:RPC failed; curl 56 LibreSSL SSL_read:SSL_ERROR_SYSCALL,errno 54
這個應(yīng)該是最常見的問題了,我基本上每一次裝cocoapods都會遇到過
這個問題可以參考這篇文章
網(wǎng)絡(luò)上往往都會說這是由于大文件造成的提交或者拉取失敗易核。但是遏弱,經(jīng)過本人測試,如果是 errno 56弦蹂,那么應(yīng)該是有大文件或者提交緩存方面的問題肩碟。而 errno 54 則不是這個問題。對于 56 錯誤的解決方式與網(wǎng)絡(luò)上大部分文章的一致凸椿。都是增大緩存配置削祈,比如下面就是配置提交緩存為 500M。
> git config http.postBuffer 524288000
> git config https.postBuffer 524288000
對于 errno 54 這個錯誤,經(jīng)嘗試 http 或者 https 協(xié)議都無法正常提交髓抑。必須改為 ssh 方式來提交代碼咙崎。也就是必須使用公私鑰的方式進(jìn)行賬號驗(yàn)證,并提交代碼吨拍。
Git配置SSH Key請參考 Git配置SSH Key
如果遇到Host key verification failed.
這個問題褪猛,是因?yàn)樵L問SSL的時候白名單不通過
使用ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
這個命令行添加白名單文件
2.curl: (60) SSL certificate problem: certificate has expired
[!] Error installing Nama-lite
[!] /usr/bin/curl -f -L -o /var/folders/cf/gr_bknqn1bl9q4l_jss_jmyc0000gn/T/d20200613-4617-1u11ee/file.zip https://www.faceunity.com/sdk/FaceUnity-SDK-iOS-v5.9.0-dev-lite.zip --create-dirs --netrc-optional --retry 2
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (60) SSL certificate problem: certificate has expired
More details here: https://curl.haxx.se/docs/sslcerts.html
curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.
解決方法
這里下載資源
1. 安裝curl-openssl
brew install curl-openssl
2. 設(shè)置環(huán)境變量
將路徑 /usr/local/opt/curl-openssl/bin
添加到 /etc/paths
文件中的第一行,重啟終端羹饰。
3. 測試pod install
進(jìn)行 pod install
安裝測試伊滋,可能會報libssl.1.0.0.dylib
和libcrypto.1.0.0.dylib
找不到的錯誤,這是由于安裝 curl-openssl
的時候队秩,安裝了更高版本的openssl笑旺,導(dǎo)致其他程序以來的低版本庫找不到。將缺少的兩個庫拷貝到錯誤提示的路徑即可馍资。
curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused
這個問題百度上很多方法筒主,但是很多都沒用,最后在知乎上找到這個方法:
# 7890 和 789 需要換成你自己的端口
export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:789
報oh no鸟蟹,an error occurred.
報這個錯的時候很可能是pod的版本不匹配乌妙,我報這個錯的時候是1.10.1版本的pod,然后我換成1.5.2版本的pod就可以了建钥,但是又報一個問題
查了一下冠胯,pod 版本要大于1.5.3,所以我又換成了pod 1.7.5版本锦针,重新pod install荠察,就成功了
sudo gem uninstall cocoapods
sudo gem install cocoapods -v 1.7.5
如果沒有權(quán)限,指定一下文件
sudo gem uninstall -n /usr/local/bin cocoapods
sudo gem install -n /usr/local/bin cocoapods version 1.7.5