RuntimeError - [Xcodeproj] Unkno
――― 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!
看到这么一“堆” 真的是无从下手,没遇到过这么长的,有经验的可能会从中找到问题所在,我是根据最初的出现--gem -- ruby等字眼,判断 可能是ruby/gem的问题
起初认为是ruby版本过低了,于是升级ruby。升级过程中发现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
一步步执行
修改 RVM 的 Ruby 安装源到 Ruby China 的 Ruby 镜像服务器,这样能提高安装速度)
$ echo "ruby_url=https://cache.ruby-china.org/pub/ruby" > ~/.rvm/user/db
之后执行: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 还是报错 但是 现在 出来明确问题出在哪了 --- /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
两步执行 最后提示 28 gems installed 安装成功
执行 pod install 成功
(最后 如果 还出现 上述问题 ruby之前没删除 ,存在好几个版本, 执行rvm --default use 2.4.1 语句 让ruby默认换成最新的版本)