Step 1: Check the different version(s) of Cocoapods installed on your Mac using following command.
gem list --local | grep cocoapods
The output will look like this:
cocoapods (1.9.0) cocoapods-core (1.9.0) cocoapods-deintegrate (1.0.4) cocoapods-downloader (1.3.0) cocoapods-plugins (1.0.0) cocoapods-search (1.0.0) cocoapods-stats (1.1.0) cocoapods-trunk (1.4.1) cocoapods-try (1.1.0)
Step 2: Remove one by one using following command.
gem uninstall [name of the cocoapod] gem uninstall cocoapods gem uninstall cocoapods-core gem uninstall cocoapods-deintegrate
If the terminal tells you that you don’t have permission to remove it then use “sudo” in command.
sudo gem uninstall [name of the cocoapod] sudo gem uninstall cocoapods sudo gem uninstall cocoapods-core sudo gem uninstall cocoapods-deintegrate
For multiple version specify the version to be removed.
gem uninstall cocoapods -v 0.20.2
Step 3: Finally, remove residual artifacts using following command.
rm -rf ~/.cocoapods
Cocoapods Mac OS uninstall