RuntimeError - [Xcodeproj] Unknown object version.Cocoapods使用過程中遇到的問題

――― MARKDOWN TEMPLATE ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

### Command

```

/Users/qqqq/.rvm/rubies/ruby-2.0.0-p643/bin/pod install

```

### Report

* What did you do?

* What did you expect to happen?

* What happened instead?

### Stack

```

?? CocoaPods : 1.2.0

? ? ? ? Ruby : ruby 2.0.0p643 (2015-02-25 revision 49749) [x86_64-darwin14.5.0]

? ? RubyGems : 2.6.6

? ? ? ? Host : Mac OS X 10.13.4 (17E199)

?? ? ? Xcode : 9.3 (9E145)

?? ? ? ? Git : git version 2.15.1 (Apple Git-101)

Ruby lib dir : /Users/qqqq/.rvm/rubies/ruby-2.0.0-p643/lib

Repositories : master - https://github.com/CocoaPods/Specs.git @ d0a0ba10caedbe7cc887411b987a5d458c8e9209

```

### Plugins

```

cocoapods-deintegrate : 1.0.1

cocoapods-plugins? ? : 1.0.0

cocoapods-search? ? ? : 1.0.0

cocoapods-stats? ? ? : 1.0.0

cocoapods-trunk? ? ? : 1.1.2

cocoapods-try? ? ? ? : 1.1.0

```

### Podfile

```ruby

platform :ios, '8.0'

use_frameworks!

target 'SilverMeter' do

end

```

### Error

```

RuntimeError - [Xcodeproj] Unknown object version.

/Users/qqqq/.rvm/gems/ruby-2.0.0-p643@global/gems/xcodeproj-1.4.2/lib/xcodeproj/project.rb:217:in `initialize_from_file'

/Users/qqqq/.rvm/gems/ruby-2.0.0-p643@global/gems/xcodeproj-1.4.2/lib/xcodeproj/project.rb:102:in `open'

/Users/qqqq/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-1.2.0/lib/cocoapods/installer/analyzer.rb:851:in `block (2 levels) in inspect_targets_to_integrate'

/Users/qqqq/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-1.2.0/lib/cocoapods/installer/analyzer.rb:850:in `each'

/Users/qqqq/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-1.2.0/lib/cocoapods/installer/analyzer.rb:850:in `block in inspect_targets_to_integrate'

/Users/qqqq/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-1.2.0/lib/cocoapods/user_interface.rb:64:in `section'

/Users/qqqq/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-1.2.0/lib/cocoapods/installer/analyzer.rb:845:in `inspect_targets_to_integrate'

/Users/qqqq/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-1.2.0/lib/cocoapods/installer/analyzer.rb:66:in `analyze'

/Users/qqqq/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-1.2.0/lib/cocoapods/installer.rb:236:in `analyze'

/Users/qqqq/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-1.2.0/lib/cocoapods/installer.rb:150:in `block in resolve_dependencies'

/Users/qqqq/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-1.2.0/lib/cocoapods/user_interface.rb:64:in `section'

/Users/qqqq/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-1.2.0/lib/cocoapods/installer.rb:149:in `resolve_dependencies'

/Users/qqqq/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-1.2.0/lib/cocoapods/installer.rb:110:in `install!'

/Users/qqqq/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-1.2.0/lib/cocoapods/command/install.rb:37:in `run'

/Users/qqqq/.rvm/gems/ruby-2.0.0-p643@global/gems/claide-1.0.1/lib/claide/command.rb:334:in `run'

/Users/qqqq/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-1.2.0/lib/cocoapods/command.rb:52:in `run'

/Users/qqqq/.rvm/gems/ruby-2.0.0-p643@global/gems/cocoapods-1.2.0/bin/pod:55:in `'

/Users/qqqq/.rvm/rubies/ruby-2.0.0-p643/bin/pod:23:in `load'

/Users/qqqq/.rvm/rubies/ruby-2.0.0-p643/bin/pod:23:in `'

```

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

[!] Oh no, an error occurred.

Search for existing GitHub issues similar to yours:

https://github.com/CocoaPods/CocoaPods/search?q=%5BXcodeproj%5D+Unknown+object+version.&type=Issues

If none exists, create a ticket, with the template displayed above, on:

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

Don't forget to anonymize any private data!

Looking for related issues on cocoapods/cocoapods...

?- RuntimeError - [Xcodeproj] Unknown object version. ??

?? https://github.com/CocoaPods/CocoaPods/issues/7712 [closed] [9 comments]

?? a week ago

?- RuntimeError - [Xcodeproj] Unknown object version.

?? https://github.com/CocoaPods/CocoaPods/issues/7697 [closed] [12 comments]

?? 18 hours ago

?- RuntimeError - [Xcodeproj] Unknown object version.

?? https://github.com/CocoaPods/CocoaPods/issues/7458 [closed] [12 comments]

?? 5 weeks ago

and 37 more at:

https://github.com/cocoapods/cocoapods/search?q=[Xcodeproj]%20Unknown%20object%20version.&type=Issues&utf8=?

[!] The Podfile does not contain any dependencies.

qqqqdeMacBook-Pro:SilverMeter qqqq$ pod search JPush?

Creating search index for spec repo 'master'.. Done!


看到這么一“堆” ?真的是無從下手,沒遇到過這么長的棕孙,有經(jīng)驗的可能會從中找到問題所在寞酿,我是根據(jù)最初的出現(xiàn)--gem ?-- ruby等字眼钮蛛,判斷 ?可能是ruby/gem的問題 ?

起初認(rèn)為是ruby版本過低了判族,于是升級ruby泊业。升級過程中發(fā)現(xiàn)RVM不存在逗扒,于是安裝RVM

(通過 ?rvm list known ?命令查看已知的 Ruby 版本寥院,提示-bash: $: command not found,說明你的RVM不存在鼠证,重新安裝下-----

$ \curl -sSL https://get.rvm.io | bash -s stable

$ source ~/.bashrc

$ source ~/.bash_profile?

一步步執(zhí)行 ??

?修改 RVM 的 Ruby 安裝源到 Ruby China 的?Ruby 鏡像服務(wù)器峡竣,這樣能提高安裝速度)

$ echo "ruby_url=https://cache.ruby-china.org/pub/ruby" > ~/.rvm/user/db

之后執(zhí)行:rvm list known ? ?查看ruby的版本?

?# 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[.7]

[ruby-]2.3[.4]

[ruby-]2.4[.1]

ruby-head

這些是ruby的版本 ?最新2.4

安裝最新ruby ------- ? ?rvm install 2.4

No checksum for downloaded archive, recording checksum in user configuration.

ruby-2.4.1 - #extracting rubygems-2.6.14....

ruby-2.4.1 - #removing old rubygems.........

ruby-2.4.1 - #installing rubygems-2.6.14...........................

ruby-2.4.1 - #gemset created /Users/qqqq/.rvm/gems/ruby-2.4.1@global

ruby-2.4.1 - #importing gemset /Users/qqqq/.rvm/gemsets/global.gems......|

ruby-2.4.1 - #generating global wrappers........

ruby-2.4.1 - #gemset created /Users/qqqq/.rvm/gems/ruby-2.4.1

ruby-2.4.1 - #importing gemsetfile /Users/qqqq/.rvm/gemsets/default.gems evaluated to empty gem list

ruby-2.4.1 - #generating default wrappers........

ruby-2.4.1 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).

Install of ruby-2.4.1 - #complete?

Ruby was built without documentation, to build it run: rvm docs generate-ri ? ??

安裝成功 ?

之后試了下 ? pod install ? 還是報錯 ? 但是 ?現(xiàn)在 出來明確問題出在哪了 ---?/Users/qqqq/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/site_ruby/2.0.0/rubygems.rb:270:in `find_spec_for_exe': can't find gem cocoapods (>= 0.a) (Gem::GemNotFoundException) ?提示我沒有找到gem ? 所以重新安裝下gem ? ----

sudo gem uninstall cocoapods

gem install cocoapods?

兩步執(zhí)行 ? ?最后提示 ??28 gems installed ?安裝成功

執(zhí)行 ?pod install ? ?成功

(最后 ?如果 ?還出現(xiàn) ?上述問題 ? ruby之前沒刪除 ,存在好幾個版本量九, ?執(zhí)行rvm --default use 2.4.1? 語句 ? ?讓ruby默認(rèn)換成最新的版本)

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末适掰,一起剝皮案震驚了整個濱河市颂碧,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌类浪,老刑警劉巖载城,帶你破解...
    沈念sama閱讀 206,126評論 6 481
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場離奇詭異费就,居然都是意外死亡诉瓦,警方通過查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 88,254評論 2 382
  • 文/潘曉璐 我一進(jìn)店門力细,熙熙樓的掌柜王于貴愁眉苦臉地迎上來睬澡,“玉大人,你說我怎么就攤上這事艳汽『锓。” “怎么了对雪?”我有些...
    開封第一講書人閱讀 152,445評論 0 341
  • 文/不壞的土叔 我叫張陵河狐,是天一觀的道長。 經(jīng)常有香客問我瑟捣,道長馋艺,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 55,185評論 1 278
  • 正文 為了忘掉前任迈套,我火速辦了婚禮捐祠,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘桑李。我一直安慰自己踱蛀,他們只是感情好,可當(dāng)我...
    茶點故事閱讀 64,178評論 5 371
  • 文/花漫 我一把揭開白布贵白。 她就那樣靜靜地躺著率拒,像睡著了一般。 火紅的嫁衣襯著肌膚如雪禁荒。 梳的紋絲不亂的頭發(fā)上猬膨,一...
    開封第一講書人閱讀 48,970評論 1 284
  • 那天,我揣著相機(jī)與錄音呛伴,去河邊找鬼勃痴。 笑死,一個胖子當(dāng)著我的面吹牛热康,可吹牛的內(nèi)容都是我干的沛申。 我是一名探鬼主播,決...
    沈念sama閱讀 38,276評論 3 399
  • 文/蒼蘭香墨 我猛地睜開眼姐军,長吁一口氣:“原來是場噩夢啊……” “哼污它!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 36,927評論 0 259
  • 序言:老撾萬榮一對情侶失蹤衫贬,失蹤者是張志新(化名)和其女友劉穎德澈,沒想到半個月后,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體固惯,經(jīng)...
    沈念sama閱讀 43,400評論 1 300
  • 正文 獨居荒郊野嶺守林人離奇死亡梆造,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 35,883評論 2 323
  • 正文 我和宋清朗相戀三年,在試婚紗的時候發(fā)現(xiàn)自己被綠了葬毫。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片镇辉。...
    茶點故事閱讀 37,997評論 1 333
  • 序言:一個原本活蹦亂跳的男人離奇死亡,死狀恐怖贴捡,靈堂內(nèi)的尸體忽然破棺而出忽肛,到底是詐尸還是另有隱情,我是刑警寧澤烂斋,帶...
    沈念sama閱讀 33,646評論 4 322
  • 正文 年R本政府宣布屹逛,位于F島的核電站,受9級特大地震影響汛骂,放射性物質(zhì)發(fā)生泄漏罕模。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點故事閱讀 39,213評論 3 307
  • 文/蒙蒙 一帘瞭、第九天 我趴在偏房一處隱蔽的房頂上張望淑掌。 院中可真熱鬧,春花似錦蝶念、人聲如沸抛腕。這莊子的主人今日做“春日...
    開封第一講書人閱讀 30,204評論 0 19
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽担敌。三九已至,卻和暖如春适袜,著一層夾襖步出監(jiān)牢的瞬間柄错,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 31,423評論 1 260
  • 我被黑心中介騙來泰國打工苦酱, 沒想到剛下飛機(jī)就差點兒被人妖公主榨干…… 1. 我叫王不留售貌,地道東北人。 一個月前我還...
    沈念sama閱讀 45,423評論 2 352
  • 正文 我出身青樓疫萤,卻偏偏與公主長得像颂跨,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個殘疾皇子扯饶,可洞房花燭夜當(dāng)晚...
    茶點故事閱讀 42,722評論 2 345

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