Recently, I need to develop a new project, so I upgraded the latest Mac OS and Xcode 9 as the project environment for development, but there is a problem when cocoaPods install, prompting RuntimeError – [Xcodeproj] Unknown object version.

Sudo gem update –system

Install the latest cocoaPods version sudo gem install -n /usr/local/bin cocoaPods –pre

Add taobao source :gem sources -a https://ruby.taobao.org/ (http://gems.ruby-china.org note: Taobao source is not maintained, replace the official Chinese source, note is HTTP, not HTTPS)

pod install

Conclusion:

CocoaPods is written in Ruby and is divided into several Gem packages. The most important package paths are CocoaPods/CocoaPods, CocoaPods/Core, and CocoaPods/Xcodeproj.

CocoaPods / CocoaPod

This is the user-facing component that is activated every time you execute a POD command. It includes all the functionality of working with CocoaPods and can also call other gem packages to perform tasks.

CocoaPods / Core

Core gem provides processing of files associated with CocoaPods (mainly Podfiles and Podspecs).

To successfully upgrade Cocoapods, you need to have the correct process and command statements.

Update gem: sudo gem update –system

2. Delete the gem source: gem sources –remove http://gems.ruby-china.org

3, add gem source: gem sources -a http://gems.ruby-china.org(Taobao source no longer maintain, replace the official Chinese source, note is HTTP, not HTTPS)

4, check whether the gem source is the latest: gem source-l

Sudo gem install -n /usr/local/bin cocoapods –pre

6. Check the current cocoapods version: POD –version

Pod install/pod install –verbose –no-repo-update