新建項目時 pod install 遇到的一些問題

錯誤信息:

RuntimeError - [Xcodeproj] Unknown object version.
/Users/huangjing/.rvm/gems/ruby-2.0.0-p643@global/gems/xcodeproj-1.4.2/lib/xcodeproj/project.rb:217:in `initialize_from_file'
/Users/huangjing/.rvm/gems/ruby-2.0.0-p643@global/gems/xcodeproj-1.4.2/lib/xcodeproj/project.rb:102:in `open'
/Users/huangjing/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-1.1.1/lib/cocoapods/installer/analyzer.rb:855:in `block (2 levels) in inspect_targets_to_integrate'
/Users/huangjing/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-1.1.1/lib/cocoapods/installer/analyzer.rb:854:in `each'
/Users/huangjing/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-1.1.1/lib/cocoapods/installer/analyzer.rb:854:in `block in inspect_targets_to_integrate'
/Users/huangjing/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-1.1.1/lib/cocoapods/user_interface.rb:64:in `section'
/Users/huangjing/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-1.1.1/lib/cocoapods/installer/analyzer.rb:849:in `inspect_targets_to_integrate'
/Users/huangjing/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-1.1.1/lib/cocoapods/installer/analyzer.rb:66:in `analyze'
/Users/huangjing/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-1.1.1/lib/cocoapods/installer.rb:236:in `analyze'
/Users/huangjing/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-1.1.1/lib/cocoapods/installer.rb:150:in `block in resolve_dependencies'
/Users/huangjing/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-1.1.1/lib/cocoapods/user_interface.rb:64:in `section'
/Users/huangjing/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-1.1.1/lib/cocoapods/installer.rb:149:in `resolve_dependencies'
/Users/huangjing/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-1.1.1/lib/cocoapods/installer.rb:110:in `install!'
/Users/huangjing/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-1.1.1/lib/cocoapods/command/install.rb:37:in `run'
/Users/huangjing/.rvm/gems/ruby-2.0.0-p643@global/gems/claide-1.0.1/lib/claide/command.rb:334:in `run'
/Users/huangjing/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-1.1.1/lib/cocoapods/command.rb:50:in `run'
/Users/huangjing/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-1.1.1/bin/pod:55:in `<top (required)>'
/Users/huangjing/.rvm/rubies/ruby-2.0.0-p643/bin/pod:23:in `load'
/Users/huangjing/.rvm/rubies/ruby-2.0.0-p643/bin/pod:23:in `<main>'
```

解決方法:更新xcodeproj

運行命令:gem update xcodeproj

再次pod install還是報錯

錯誤信息:

ArgumentError - Malformed version number string 
/Users/huangjing/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/site_ruby/2.0.0/rubygems/version.rb:209:in `initialize'
/Users/huangjing/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/site_ruby/2.0.0/rubygems/version.rb:200:in `new'
/Users/huangjing/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/site_ruby/2.0.0/rubygems/version.rb:200:in `new'
/Users/huangjing/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-1.1.1/lib/cocoapods/generator/xcconfig/aggregate_xcconfig.rb:110:in `embedded_content_settings'
/Users/huangjing/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-1.1.1/lib/cocoapods/generator/xcconfig/aggregate_xcconfig.rb:63:in `generate'
/Users/huangjing/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-1.1.1/lib/cocoapods/generator/xcconfig/aggregate_xcconfig.rb:39:in `save_as'
/Users/huangjing/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-1.1.1/lib/cocoapods/installer/xcode/pods_project_generator/aggregate_target_installer.rb:87:in `block in create_xcconfig_file'
/Users/huangjing/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-1.1.1/lib/cocoapods/installer/xcode/pods_project_generator/aggregate_target_installer.rb:84:in `each'
/Users/huangjing/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-1.1.1/lib/cocoapods/installer/xcode/pods_project_generator/aggregate_target_installer.rb:84:in `create_xcconfig_file'
/Users/huangjing/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-1.1.1/lib/cocoapods/installer/xcode/pods_project_generator/aggregate_target_installer.rb:18:in `block in install!'
/Users/huangjing/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-1.1.1/lib/cocoapods/user_interface.rb:142:in `message'
/Users/huangjing/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-1.1.1/lib/cocoapods/installer/xcode/pods_project_generator/aggregate_target_installer.rb:14:in `install!'
/Users/huangjing/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-1.1.1/lib/cocoapods/installer/xcode/pods_project_generator.rb:160:in `block (2 levels) in install_libraries'
/Users/huangjing/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-1.1.1/lib/cocoapods/installer/xcode/pods_project_generator.rb:158:in `each'
/Users/huangjing/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-1.1.1/lib/cocoapods/installer/xcode/pods_project_generator.rb:158:in `block in install_libraries'
/Users/huangjing/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-1.1.1/lib/cocoapods/user_interface.rb:142:in `message'
/Users/huangjing/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-1.1.1/lib/cocoapods/installer/xcode/pods_project_generator.rb:152:in `install_libraries'
/Users/huangjing/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-1.1.1/lib/cocoapods/installer/xcode/pods_project_generator.rb:64:in `generate!'
/Users/huangjing/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-1.1.1/lib/cocoapods/installer.rb:179:in `block in generate_pods_project'
/Users/huangjing/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-1.1.1/lib/cocoapods/user_interface.rb:64:in `section'
/Users/huangjing/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-1.1.1/lib/cocoapods/installer.rb:178:in `generate_pods_project'
/Users/huangjing/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-1.1.1/lib/cocoapods/installer.rb:115:in `install!'
/Users/huangjing/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-1.1.1/lib/cocoapods/command/install.rb:37:in `run'
/Users/huangjing/.rvm/gems/ruby-2.0.0-p643/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
/Users/huangjing/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-1.1.1/lib/cocoapods/command.rb:50:in `run'
/Users/huangjing/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-1.1.1/bin/pod:55:in `<top (required)>'
/Users/huangjing/.rvm/rubies/ruby-2.0.0-p643/bin/pod:23:in `load'
/Users/huangjing/.rvm/rubies/ruby-2.0.0-p643/bin/pod:23:in `<main>'

然后查看ruby版本

rvm list known

列表里最新版本只到2.2(最新2.6.0) 并提示rvm版本落后于最新版本

于是更新rvm版本

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

再次查看ruby版本

rvm list known

查找結(jié)果如下
# MRI Rubies
[ruby-]1.8.6[-p420]
[ruby-]1.8.7[-head] # security released on head
[ruby-]1.9.1[-p431]
[ruby-]1.9.2[-p330]
[ruby-]1.9.3[-p551]
[ruby-]2.0.0[-p648]
[ruby-]2.1[.10]
[ruby-]2.2[.10]
[ruby-]2.3[.7]
[ruby-]2.4[.4]
[ruby-]2.5[.1]
[ruby-]2.6[.0-preview2]
ruby-head

# for forks use: rvm install ruby-head-<name> --url https://github.com/github/ruby.git --branch 2.2

# JRuby
jruby-1.6[.8]
jruby-1.7[.27]
jruby-9.1[.17.0]
jruby[-9.2.0.0]
jruby-head

# Rubinius
rbx-1[.4.3]
rbx-2.3[.0]
rbx-2.4[.1]
rbx-2[.5.8]
rbx-3[.100]
rbx-head

# TruffleRuby
truffleruby[-1.0.0-rc2]

# Opal
opal

# Minimalistic ruby implementation - ISO 30170:2012
mruby-1.0.0
mruby-1.1.0
mruby-1.2.0
mruby-1.3.0
mruby-1[.4.0]
mruby[-head]

# Ruby Enterprise Edition
ree-1.8.6
ree[-1.8.7][-2012.02]

# Topaz
topaz

# MagLev
maglev-1.0.0
maglev-1.1[RC1]
maglev[-1.2Alpha4]
maglev-head

# Mac OS X Snow Leopard Or Newer
macruby-0.10
macruby-0.11
macruby[-0.12]
macruby-nightly
macruby-head

# IronRuby
ironruby[-1.1.3]
ironruby-head
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

安裝多個xcode后刪除原xcodebuild的路徑導(dǎo)致pod install失敗  

解決方案:
sudo gem uninstall cocoapods

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末,一起剝皮案震驚了整個濱河市,隨后出現(xiàn)的幾起案子吗货,更是在濱河造成了極大的恐慌,老刑警劉巖京郑,帶你破解...
    沈念sama閱讀 212,542評論 6 493
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場離奇詭異葫掉,居然都是意外死亡些举,警方通過查閱死者的電腦和手機,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 90,596評論 3 385
  • 文/潘曉璐 我一進(jìn)店門俭厚,熙熙樓的掌柜王于貴愁眉苦臉地迎上來金拒,“玉大人,你說我怎么就攤上這事套腹。” “怎么了资铡?”我有些...
    開封第一講書人閱讀 158,021評論 0 348
  • 文/不壞的土叔 我叫張陵电禀,是天一觀的道長。 經(jīng)常有香客問我笤休,道長尖飞,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 56,682評論 1 284
  • 正文 為了忘掉前任店雅,我火速辦了婚禮政基,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘闹啦。我一直安慰自己沮明,他們只是感情好,可當(dāng)我...
    茶點故事閱讀 65,792評論 6 386
  • 文/花漫 我一把揭開白布窍奋。 她就那樣靜靜地躺著荐健,像睡著了一般。 火紅的嫁衣襯著肌膚如雪琳袄。 梳的紋絲不亂的頭發(fā)上江场,一...
    開封第一講書人閱讀 49,985評論 1 291
  • 那天,我揣著相機與錄音窖逗,去河邊找鬼址否。 笑死,一個胖子當(dāng)著我的面吹牛碎紊,可吹牛的內(nèi)容都是我干的佑附。 我是一名探鬼主播樊诺,決...
    沈念sama閱讀 39,107評論 3 410
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼帮匾!你這毒婦竟也來了啄骇?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 37,845評論 0 268
  • 序言:老撾萬榮一對情侶失蹤瘟斜,失蹤者是張志新(化名)和其女友劉穎缸夹,沒想到半個月后,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體螺句,經(jīng)...
    沈念sama閱讀 44,299評論 1 303
  • 正文 獨居荒郊野嶺守林人離奇死亡虽惭,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 36,612評論 2 327
  • 正文 我和宋清朗相戀三年,在試婚紗的時候發(fā)現(xiàn)自己被綠了蛇尚。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片芽唇。...
    茶點故事閱讀 38,747評論 1 341
  • 序言:一個原本活蹦亂跳的男人離奇死亡,死狀恐怖取劫,靈堂內(nèi)的尸體忽然破棺而出匆笤,到底是詐尸還是另有隱情,我是刑警寧澤谱邪,帶...
    沈念sama閱讀 34,441評論 4 333
  • 正文 年R本政府宣布炮捧,位于F島的核電站,受9級特大地震影響惦银,放射性物質(zhì)發(fā)生泄漏咆课。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點故事閱讀 40,072評論 3 317
  • 文/蒙蒙 一扯俱、第九天 我趴在偏房一處隱蔽的房頂上張望书蚪。 院中可真熱鬧,春花似錦迅栅、人聲如沸殊校。這莊子的主人今日做“春日...
    開封第一講書人閱讀 30,828評論 0 21
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽箩艺。三九已至,卻和暖如春宪萄,著一層夾襖步出監(jiān)牢的瞬間艺谆,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 32,069評論 1 267
  • 我被黑心中介騙來泰國打工拜英, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留静汤,地道東北人。 一個月前我還...
    沈念sama閱讀 46,545評論 2 362
  • 正文 我出身青樓,卻偏偏與公主長得像虫给,于是被迫代替她去往敵國和親藤抡。 傳聞我的和親對象是個殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點故事閱讀 43,658評論 2 350

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