iOS解决新项目无法pod install的解决办法

新建了一个项目,在项目里创建了Podfile文件,使用pdo install命令无法安装成功,报错信息如下:
[!] 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/7458 [closed] [17 comments]
    4 weeks ago

  • RuntimeError - [Xcodeproj] Unknown object version.
    https://github.com/CocoaPods/CocoaPods/issues/6992 [closed] [15 comments]
    6 weeks ago

  • Pod Update: RuntimeError - [Xcodeproj] Unknown object version. Xcode Beta 5
    https://github.com/CocoaPods/CocoaPods/issues/8003 [closed] [18 comments]
    29 Oct 2018

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

各种折腾,还删除了cocoapods,结果装不上了,后来才发现镜像源域名(https://gems.ruby-china.org/)换了,更改为了https://gems.ruby-china.com/

解决办法:

gem sources -l 查看当前是什么连接
gem sources --remove https://gems.ruby-china.org/ 然后移除旧源,改用新源
gem sources -a https://gems.ruby-china.com/

再重新安装cocoapods : sudo gem install cocoapods
成功安装后查看版本 xcodeproj --version 显示为1.7.0

这时通过pod install命令即可成功安装

你可能感兴趣的:(iOS解决新项目无法pod install的解决办法)