Sometimes you will need to use a specific version of Cocoapods, usually when you want to downgrade a cocoa pods. Here is what you need to do.

First install the specific version.

1
sudo gem install cocoapods -v 1.6.1

Second uninstall the other version

1
sudo gem uninstall cocoapods

The above command will let you choose which version you want to uninstall if you have multiple version installed.

Last But Not Least check current version

1
pod --version

Now use the above command to check your current version.