CocoPods更換Ruby源及升級版本

升級xcode11间聊,項目適配iOS13蟀淮,MJExtension報錯尤仍,github上提示需要更新最新版本遍烦,使用終端 $pod search MJExtension 發(fā)現(xiàn)并無3.1.0及以上版本,而查看releases卻發(fā)現(xiàn)已經(jīng)更新到3.2.1拨拓,故需更新cocopods并更新本地庫緩存肴颊,記錄一下。
提示更新

1渣磷、查看當前cocopods版本

$ pod --version

fangcundeMacBook-Pro:~ fangcun$  pod --version
1.5.3

2婿着、查看Ruby源

$ gem source -l

fangcundeMacBook-Pro:~ fangcun$ gem source -l
*** CURRENT SOURCES ***

https://gems.ruby-china.org

3、升級cocopods (需要輸入密碼,密碼不會顯示竟宋,輸完回車)

$ sudo gem install cocoapods

fangcundeMacBook-Pro:~ fangcun$ sudo gem install cocoapods
Password:
ERROR:  Could not find a valid gem 'cocoapods' (>= 0), here is why:
          Unable to download data from https://gems.ruby-china.org - bad response Not Found 404 (https://gems.ruby-china.org/specs.4.8.gz)

升級報錯:Not Found 404提完,意思是當前源(https://gems.ruby-china.org)找不到了。在瀏覽器中瀏覽當前源丘侠,提示“服務域名更換公告”

源更換公告

解決:按公告提示更換源地址

3徒欣、刪掉當前源

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

說明:此處一直提示(source https://rubygems.org/ not present in cache),意思是沒有刪除源蜗字,我找了好多方法打肝,都沒用,一直是該提示挪捕。我后來沒有進行處理粗梭,直接執(zhí)行第4步,添加新的源担神,再查看楼吃,發(fā)現(xiàn)已經(jīng)替換。提醒當遇到此類問題妄讯,不要糾結(jié)孩锡。

fangcundeMacBook-Pro:~ fangcun$ gem sources --remove https://rubygems.org/
source https://rubygems.org/ not present in cache

4、添加新源

$ gem sources --add https://gems.ruby-china.com/

fangcundeMacBook-Pro:~ fangcun$ gem sources --add https://gems.ruby-china.com/
https://gems.ruby-china.com/ added to sources

5亥贸、查看當前源

$ gem source -l

fangcundeMacBook-Pro:~ fangcun$ gem source -l
*** CURRENT SOURCES ***

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

6躬窜、升級cocopods

$ sudo gem install cocoapods

Password:
Fetching: httpclient-2.8.3.gem (100%)
Successfully installed httpclient-2.8.3
Fetching: algoliasearch-1.27.1.gem (100%)
Successfully installed algoliasearch-1.27.1
Fetching: concurrent-ruby-1.1.5.gem (100%)
Successfully installed concurrent-ruby-1.1.5
Fetching: cocoapods-core-1.8.3.gem (100%)
Successfully installed cocoapods-core-1.8.3
Fetching: cocoapods-deintegrate-1.0.4.gem (100%)
Successfully installed cocoapods-deintegrate-1.0.4
Fetching: cocoapods-downloader-1.2.2.gem (100%)
Successfully installed cocoapods-downloader-1.2.2
Fetching: cocoapods-trunk-1.4.1.gem (100%)
Successfully installed cocoapods-trunk-1.4.1
Fetching: molinillo-0.6.6.gem (100%)
Successfully installed molinillo-0.6.6
Fetching: atomos-0.1.3.gem (100%)
Successfully installed atomos-0.1.3
Fetching: nanaimo-0.2.6.gem (100%)
Successfully installed nanaimo-0.2.6
Fetching: xcodeproj-1.12.0.gem (100%)
Successfully installed xcodeproj-1.12.0
Fetching: fourflusher-2.3.1.gem (100%)
Successfully installed fourflusher-2.3.1
Fetching: ruby-macho-1.4.0.gem (100%)
Successfully installed ruby-macho-1.4.0
Fetching: cocoapods-1.8.3.gem (100%)
Successfully installed cocoapods-1.8.3
Parsing documentation for httpclient-2.8.3
Installing ri documentation for httpclient-2.8.3
Parsing documentation for algoliasearch-1.27.1
Installing ri documentation for algoliasearch-1.27.1
Parsing documentation for concurrent-ruby-1.1.5
Installing ri documentation for concurrent-ruby-1.1.5
Parsing documentation for cocoapods-core-1.8.3
Installing ri documentation for cocoapods-core-1.8.3
Parsing documentation for cocoapods-deintegrate-1.0.4
Installing ri documentation for cocoapods-deintegrate-1.0.4
Parsing documentation for cocoapods-downloader-1.2.2
Installing ri documentation for cocoapods-downloader-1.2.2
Parsing documentation for cocoapods-trunk-1.4.1
Installing ri documentation for cocoapods-trunk-1.4.1
Parsing documentation for molinillo-0.6.6
Installing ri documentation for molinillo-0.6.6
Parsing documentation for atomos-0.1.3
Installing ri documentation for atomos-0.1.3
Parsing documentation for nanaimo-0.2.6
Installing ri documentation for nanaimo-0.2.6
Parsing documentation for xcodeproj-1.12.0
Installing ri documentation for xcodeproj-1.12.0
Parsing documentation for fourflusher-2.3.1
Installing ri documentation for fourflusher-2.3.1
Parsing documentation for ruby-macho-1.4.0
Installing ri documentation for ruby-macho-1.4.0
Parsing documentation for cocoapods-1.8.3
Installing ri documentation for cocoapods-1.8.3
Done installing documentation for httpclient, algoliasearch, concurrent-ruby, cocoapods-core, cocoapods-deintegrate, cocoapods-downloader, cocoapods-trunk, molinillo, atomos, nanaimo, xcodeproj, fourflusher, ruby-macho, cocoapods after 23 seconds
14 gems installed

查看版本號
$ pod --version

fangcundeMacBook-Pro:~ fangcun$ pod --version
1.8.3

更新完成,修改MJExtension版本號并cd到項目進行pod install更新炕置,解決報錯問題荣挨。

注:有時候github的三方庫的版本號與終端pod search 搜索出來的版本號對應不上,是因為本地cocopods緩存問題朴摊,此時需要執(zhí)行 pod repo update 更新一下即可默垄。

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末,一起剝皮案震驚了整個濱河市甚纲,隨后出現(xiàn)的幾起案子口锭,更是在濱河造成了極大的恐慌,老刑警劉巖介杆,帶你破解...
    沈念sama閱讀 217,542評論 6 504
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件鹃操,死亡現(xiàn)場離奇詭異,居然都是意外死亡春哨,警方通過查閱死者的電腦和手機荆隘,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,822評論 3 394
  • 文/潘曉璐 我一進店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來赴背,“玉大人椰拒,你說我怎么就攤上這事晶渠。” “怎么了耸三?”我有些...
    開封第一講書人閱讀 163,912評論 0 354
  • 文/不壞的土叔 我叫張陵乱陡,是天一觀的道長。 經(jīng)常有香客問我仪壮,道長,這世上最難降的妖魔是什么胳徽? 我笑而不...
    開封第一講書人閱讀 58,449評論 1 293
  • 正文 為了忘掉前任积锅,我火速辦了婚禮,結(jié)果婚禮上养盗,老公的妹妹穿的比我還像新娘缚陷。我一直安慰自己,他們只是感情好往核,可當我...
    茶點故事閱讀 67,500評論 6 392
  • 文/花漫 我一把揭開白布箫爷。 她就那樣靜靜地躺著,像睡著了一般聂儒。 火紅的嫁衣襯著肌膚如雪虎锚。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 51,370評論 1 302
  • 那天衩婚,我揣著相機與錄音窜护,去河邊找鬼。 笑死非春,一個胖子當著我的面吹牛柱徙,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播奇昙,決...
    沈念sama閱讀 40,193評論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼护侮,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了储耐?” 一聲冷哼從身側(cè)響起羊初,我...
    開封第一講書人閱讀 39,074評論 0 276
  • 序言:老撾萬榮一對情侶失蹤,失蹤者是張志新(化名)和其女友劉穎弧岳,沒想到半個月后凳忙,有當?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 45,505評論 1 314
  • 正文 獨居荒郊野嶺守林人離奇死亡禽炬,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 37,722評論 3 335
  • 正文 我和宋清朗相戀三年涧卵,在試婚紗的時候發(fā)現(xiàn)自己被綠了。 大學時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片腹尖。...
    茶點故事閱讀 39,841評論 1 348
  • 序言:一個原本活蹦亂跳的男人離奇死亡柳恐,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情乐设,我是刑警寧澤讼庇,帶...
    沈念sama閱讀 35,569評論 5 345
  • 正文 年R本政府宣布,位于F島的核電站近尚,受9級特大地震影響蠕啄,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜戈锻,卻給世界環(huán)境...
    茶點故事閱讀 41,168評論 3 328
  • 文/蒙蒙 一歼跟、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧格遭,春花似錦哈街、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,783評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至璧微,卻和暖如春作箍,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背往毡。 一陣腳步聲響...
    開封第一講書人閱讀 32,918評論 1 269
  • 我被黑心中介騙來泰國打工蒙揣, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留,地道東北人开瞭。 一個月前我還...
    沈念sama閱讀 47,962評論 2 370
  • 正文 我出身青樓懒震,卻偏偏與公主長得像,于是被迫代替她去往敵國和親嗤详。 傳聞我的和親對象是個殘疾皇子个扰,可洞房花燭夜當晚...
    茶點故事閱讀 44,781評論 2 354