How to solve pod update fails with RuntimeError – [Xcodeproj] Unknown object version (macOS Sierra and xcode 9.0)

 
Solve pod update fails with RuntimeError - [Xcodeproj] Unknown object version (macOS Sierra and xcode 9.0)
 

Solve pod update fails with RuntimeError – [Xcodeproj] Unknown object version (macOS Sierra and xcode 9.0)

As per the heading, in this tutorial we will learn how to solve pod install or pod update error that it fails with run-time error – [Xcodeproj] unknown object version. Also we will, solve another error 
operation not permitted – /usr/bin/pod cocoa-pods. So basically we will solve the below two errors

1) pod install or pod update fails with run-time error – [Xcodeproj] unknown object version

2) operation not permitted – /usr/bin/pod cocoa-pods

Below are the steps to solve the above listed two errors
 
Step 1: Open terminal and type command   
sudo gem install cocoapods
How to solve pod update fails with RuntimeError - [Xcodeproj] Unknown object version (macOS Sierra and xcode 9.0)
Step 2: It will ask for password, enter your system password.
Step 3: If you get error as shown in the picture below then see step 4.
How to solve pod update fails with RuntimeError - [Xcodeproj] Unknown object version (macOS Sierra and xcode 9.0)
Step 4:  Run the command 

sudo gem install -n /usr/local/bin cocoapods
 
operation not permitted - /usr/bin/pod cocoapods
 
Step 5:  Your pods were successfully installed and now you can install pods for your xcode project.
 
How to solve pod update fails with RuntimeError - [Xcodeproj] Unknown object version (macOS Sierra and xcode 9.0)

Where to go from here

In this tutorial we  learned how to solve pod install or pod update error that it fails with run-time error – [Xcodeproj] unknown object version and second error operation not permitted – /usr/bin/pod cocoa-pods
Note:
Video tutorial  is also available. You can watch the video tutorial Youtube video link