iOS解決新項目無法pod install的解決辦法

新建了一個項目,在項目里創(chuàng)建了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...

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

各種折騰,還刪除了cocoapods,結果裝不上了,后來才發(fā)現(xiàn)鏡像源域名(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命令即可成功安裝

?著作權歸作者所有,轉載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容