pod的安裝以及錯誤提示處理方法

1.安裝RVM ,升級Ruby環(huán)境?

(1)ruby -v //查看Ruby版本號

(2)安裝RVM

curl -L get.rvm.io | bash -s stable

source ~/.bashrc

source ~/.bash_profile

(3)查看rvm版本號

rvm -v?

顯示如下

rvm 1.29.4 (latest) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io]

(4)列出ruby可安裝的版本信息

rvm list known

顯示如下


(5)安裝一個ruby版本(這里我選擇的是2.4.1版本,當然你也可以選擇其他的

rvm install 2.4.1

(6)設置為默認版本

rvm use 2.4.1 --default

2.更換源(以前的taobao Gems源【https://ruby.taobao.org】已停止維護 ,用https://gems.ruby-china.org/)

(1)sudo gem update --system

gem sources --remove https://rubygems.org/

gem sources -a https://gems.ruby-china.org/

(2)查看源

gem sources -l

如下:

*** CURRENT SOURCES ***

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

3.開始安裝

(1)sudo gem install -n /usr/local/bin cocoapods

(2)如果安裝了多個Xcode使用下面的命令選擇(一般需要選擇最近的Xcode版本)

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

(3)安裝本地庫

pod setup

完成后應該如下

Setting up CocoaPods master repo

? $ /usr/bin/git clone https://github.com/CocoaPods/Specs.git master --progress

? Cloning into 'master'...

? remote: Counting objects: 1879515, done.? ? ? ?

? remote: Compressing objects: 100% (321/321), done.? ? ? ?

? Receiving objects:? 21% (404525/1879515), 73.70 MiB | 22.00 KiB/

然后就是漫長的等待,當然,網(wǎng)絡好的情況下會更快


執(zhí)行pod setup錯誤提示:

[!] /usr/bin/git clone https://github.com/CocoaPods/Specs.git master --progress

Cloning into 'master'...

remote: Counting objects: 2278904, done.? ? ? ?

remote: Compressing objects: 100% (503/503), done.? ? ? ?

error: RPC failed; curl 18 transfer closed with outstanding read data remaining

fatal: The remote end hung up unexpectedly

fatal: early EOF

fatal: index-pack failed

解決方法

<1>

git?config?--global?http.postBuffer?524288000

git?config?--list //查看列表

<2> 執(zhí)行Git clone https://git.coding.net/CocoaPods/Specs.git ~/.cocoapods/repos/master和pod setup效果一樣,之后在更新。成功率會提高哦

<3>如果一直慢的要死,,,卡的要死,,,網(wǎng)絡不給力。。。。直接下載替換吧。。。。。。。。

鏈接: https://pan.baidu.com/s/1wriINtoLn3LI4Ik_a9NFVg 密碼: 8qdq

<4>2021.1.22改,

可直接傳到git再克隆到~/.cocoapods/repos/master

(https://gitee.com/wangtongmin/specs.git)

~/.cocoapods/repos/master去到這個目錄直接替換,,,,簡單粗暴吧。。。哈哈哈!??!

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯(lián)系作者
【社區(qū)內容提示】社區(qū)部分內容疑似由AI輔助生成,瀏覽時請結合常識與多方信息審慎甄別。
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發(fā)布,文章內容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

友情鏈接更多精彩內容