Malformed version number string--iOS.cocoapod安裝報(bào)錯(cuò)

最近新?lián)Q電腦安裝cocospod時(shí)出現(xiàn)點(diǎn)小問題,安裝時(shí)一路走下去都OK,到最后pod install時(shí)報(bào)出一個(gè)s[!] Oh no, an error occurred.具體如下圖厅篓,



ArgumentError - Malformed version number string 
/Library/Ruby/Site/2.3.0/rubygems/version.rb:209:in `initialize'
/Library/Ruby/Site/2.3.0/rubygems/version.rb:200:in `new'
/Library/Ruby/Site/2.3.0/rubygems/version.rb:200:in `new'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.2/lib/cocoapods/generator/xcconfig/aggregate_xcconfig.rb:123:in `embedded_content_settings'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.2/lib/cocoapods/generator/xcconfig/aggregate_xcconfig.rb:68:in `generate'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.2/lib/cocoapods/generator/xcconfig/aggregate_xcconfig.rb:39:in `save_as'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.2/lib/cocoapods/installer/xcode/pods_project_generator/target_installer.rb:112:in `update_changed_file'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.2/lib/cocoapods/installer/xcode/pods_project_generator/aggregate_target_installer.rb:96:in `block in create_xcconfig_file'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.2/lib/cocoapods/installer/xcode/pods_project_generator/aggregate_target_installer.rb:93:in `each'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.2/lib/cocoapods/installer/xcode/pods_project_generator/aggregate_target_installer.rb:93:in `create_xcconfig_file'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.2/lib/cocoapods/installer/xcode/pods_project_generator/aggregate_target_installer.rb:18:in `block in install!'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.2/lib/cocoapods/user_interface.rb:142:in `message'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.2/lib/cocoapods/installer/xcode/pods_project_generator/aggregate_target_installer.rb:14:in `install!'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.2/lib/cocoapods/installer/xcode/pods_project_generator.rb:181:in `block (2 levels) in install_libraries'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.2/lib/cocoapods/installer/xcode/pods_project_generator.rb:179:in `each'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.2/lib/cocoapods/installer/xcode/pods_project_generator.rb:179:in `block in install_libraries'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.2/lib/cocoapods/user_interface.rb:142:in `message'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.2/lib/cocoapods/installer/xcode/pods_project_generator.rb:167:in `install_libraries'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.2/lib/cocoapods/installer/xcode/pods_project_generator.rb:65:in `generate!'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.2/lib/cocoapods/installer.rb:184:in `block in generate_pods_project'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.2/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.2/lib/cocoapods/installer.rb:183:in `generate_pods_project'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.2/lib/cocoapods/installer.rb:119:in `install!'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.2/lib/cocoapods/command/install.rb:41:in `run'
/Library/Ruby/Gems/2.3.0/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.2/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.2/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'

――― TEMPLATE END ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

[!] Oh no, an error occurred.

Search for existing GitHub issues similar to yours:
[https://github.com/CocoaPods/CocoaPods/search?q=Malformed+version+number+string+&type=Issues](https://github.com/CocoaPods/CocoaPods/search?q=Malformed+version+number+string+&type=Issues)

If none exists, create a ticket, with the template displayed above, on:
[https://github.com/CocoaPods/CocoaPods/issues/new](https://github.com/CocoaPods/CocoaPods/issues/new)

Be sure to first read the contributing guide for details on how to properly submit a ticket:
[https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md](https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md)

Don't forget to anonymize any private data!

Looking for related issues on cocoapods/cocoapods...

*   Malformed version number string
    [#7765](https://github.com/CocoaPods/CocoaPods/issues/7765) [open] [12 comments]
    4 hours ago

*   ArgumentError - Malformed version number string $(inherited)
    [#6634](https://github.com/CocoaPods/CocoaPods/issues/6634) [closed] [5 comments]
    20 hours ago

*   help!
    [#7763](https://github.com/CocoaPods/CocoaPods/issues/7763) [closed] [2 comments]
    15 hours ago

and 31 more at:
[https://github.com/cocoapods/cocoapods/search?q=Malformed%20version%20number%20string%20&type=Issues&utf8=?](https://github.com/cocoapods/cocoapods/search?q=Malformed%20version%20number%20string%20&type=Issues&utf8=%E2%9C%93)

這就很尷尬了艺糜,然后我網(wǎng)上搜了一下還沒有解決的方法,于是只能按照提示上github上重新找結(jié)果蝠嘉,還好我看到有很多人都有這樣的問題缴允,于是按照給出來的解決方案解決了問題。

如何解決

簡(jiǎn)單來說就是一句話珍德,升級(jí)ruby并且重新安裝cocoapod


屏幕快照 2018-05-25 下午6.18.59.png

怎么解決

1.終端輸入ruby - v 练般,查看ruby版本,這里我發(fā)現(xiàn)自己ruby的版本記為2.3.3锈候。
2.然后輸入rvm list known 薄料,查看當(dāng)前所有ruby版本,發(fā)現(xiàn)最新版本已經(jīng)到2.4 .1泵琳。
3.所以重新 rvm install 2.4.1導(dǎo)入最新版摄职,這里需要提醒一下,可以提前把xcode版本和mac版本都升級(jí)為最新获列,不然會(huì)卡坠仁小(其實(shí)也不是卡,終端會(huì)自動(dòng)下載击孩,但總感覺沒有自己下載快)迫悠。期間安裝homebrew記得輸入兩次回車,不要傻等哦巩梢。
4.如果沒有問題的話看到 Install of ruby-2.4.1 - #complete 這句話就算是安裝成功创泄,可以進(jìn)行下一步了。
5.接下來重新安裝cocoapod括蝠,終端輸入sudo gem install -n /usr/local/bin cocoapods鞠抑,這里需要說一點(diǎn),老版本直接sudo gem install cocoapods就行了忌警,但是新版的mac系統(tǒng)不支持直接進(jìn)入搁拙,所以需要自己設(shè)置安裝位置。
6.沒問題的話最后輸入pod setup,這期間可能需要稍微等待一下感混,最后看到Setup completed就成功了端幼,可以盡情pod install了。

當(dāng)時(shí)cocopod導(dǎo)入的時(shí)候出現(xiàn)故障確實(shí)挺煩的弧满,網(wǎng)上也沒有搜到靠破的解決方案婆跑,最后根據(jù)報(bào)錯(cuò)提示在github issues上找到了問題的解決方案,同時(shí)也發(fā)現(xiàn)大家都是最近幾天才出的問題庭呜,所以想要寫一下以備別人多走彎路滑进。本人郵箱1441704523@qq.com,不懂的地方可以加之共勉

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末,一起剝皮案震驚了整個(gè)濱河市募谎,隨后出現(xiàn)的幾起案子扶关,更是在濱河造成了極大的恐慌,老刑警劉巖数冬,帶你破解...
    沈念sama閱讀 206,214評(píng)論 6 481
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件节槐,死亡現(xiàn)場(chǎng)離奇詭異,居然都是意外死亡拐纱,警方通過查閱死者的電腦和手機(jī)铜异,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 88,307評(píng)論 2 382
  • 文/潘曉璐 我一進(jìn)店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來秸架,“玉大人揍庄,你說我怎么就攤上這事《ǎ” “怎么了蚂子?”我有些...
    開封第一講書人閱讀 152,543評(píng)論 0 341
  • 文/不壞的土叔 我叫張陵,是天一觀的道長(zhǎng)缭黔。 經(jīng)常有香客問我食茎,道長(zhǎng),這世上最難降的妖魔是什么馏谨? 我笑而不...
    開封第一講書人閱讀 55,221評(píng)論 1 279
  • 正文 為了忘掉前任董瞻,我火速辦了婚禮,結(jié)果婚禮上田巴,老公的妹妹穿的比我還像新娘钠糊。我一直安慰自己,他們只是感情好壹哺,可當(dāng)我...
    茶點(diǎn)故事閱讀 64,224評(píng)論 5 371
  • 文/花漫 我一把揭開白布抄伍。 她就那樣靜靜地躺著,像睡著了一般管宵。 火紅的嫁衣襯著肌膚如雪截珍。 梳的紋絲不亂的頭發(fā)上攀甚,一...
    開封第一講書人閱讀 49,007評(píng)論 1 284
  • 那天,我揣著相機(jī)與錄音岗喉,去河邊找鬼秋度。 笑死,一個(gè)胖子當(dāng)著我的面吹牛钱床,可吹牛的內(nèi)容都是我干的荚斯。 我是一名探鬼主播,決...
    沈念sama閱讀 38,313評(píng)論 3 399
  • 文/蒼蘭香墨 我猛地睜開眼查牌,長(zhǎng)吁一口氣:“原來是場(chǎng)噩夢(mèng)啊……” “哼事期!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起纸颜,我...
    開封第一講書人閱讀 36,956評(píng)論 0 259
  • 序言:老撾萬榮一對(duì)情侶失蹤兽泣,失蹤者是張志新(化名)和其女友劉穎,沒想到半個(gè)月后胁孙,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體唠倦,經(jīng)...
    沈念sama閱讀 43,441評(píng)論 1 300
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 35,925評(píng)論 2 323
  • 正文 我和宋清朗相戀三年涮较,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了牵敷。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點(diǎn)故事閱讀 38,018評(píng)論 1 333
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡法希,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出靶瘸,到底是詐尸還是另有隱情苫亦,我是刑警寧澤,帶...
    沈念sama閱讀 33,685評(píng)論 4 322
  • 正文 年R本政府宣布怨咪,位于F島的核電站屋剑,受9級(jí)特大地震影響,放射性物質(zhì)發(fā)生泄漏诗眨。R本人自食惡果不足惜唉匾,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 39,234評(píng)論 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望匠楚。 院中可真熱鬧巍膘,春花似錦、人聲如沸芋簿。這莊子的主人今日做“春日...
    開封第一講書人閱讀 30,240評(píng)論 0 19
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽与斤。三九已至肪康,卻和暖如春荚恶,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背磷支。 一陣腳步聲響...
    開封第一講書人閱讀 31,464評(píng)論 1 261
  • 我被黑心中介騙來泰國打工谒撼, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留,地道東北人雾狈。 一個(gè)月前我還...
    沈念sama閱讀 45,467評(píng)論 2 352
  • 正文 我出身青樓廓潜,卻偏偏與公主長(zhǎng)得像,于是被迫代替她去往敵國和親箍邮。 傳聞我的和親對(duì)象是個(gè)殘疾皇子茉帅,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 42,762評(píng)論 2 345

推薦閱讀更多精彩內(nèi)容