――― 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)換成最新的版本)