I installed Cocoapods version 0.28, and now I want to uninstall it from my machine. How can I do that?
First, determine which version(s) of Cocoapods you have installed by running this in Terminal:
gem list --local | grep cocoapods
You see output similar to this:
cocoapods (0.27.1, 0.20.2) cocoapods-core (0.27.1, 0.20.2) cocoapods-downloader (0.2.0, 0.1.2)
Here, I have two versions of Cocoapods installed.
To completely remove, issue the following commands:
gem uninstall cocoapods gem uninstall cocoapods-core gem uninstall cocoapods-downloader
If you have multiple versions installed, like I have, it will prompt you to choice a specific version or all. If you want to uninstall a specific version you can also use the
-v switch as follows:
gem uninstall cocoapods -v 0.20.2
gem list --local | grep cocoapods again will confirm that Cocoapods has been removed.
You may have residual artefacts in a hidden folder in your home directory. Remove these with:
rm -rf ~/.cocoapods
I was following this answer but for Mac OS X El Capitan 10.11 I was encountering an error as below on executing
gem uninstall -n cocoapods command
pranav-MacBook-Pro:~ pranavpranav$ gem uninstall -n cocoapods ERROR: While executing gem ... (Gem::CommandLineError) Please specify at least one gem name (e.g. gem build GEMNAME)
In order to overcome the issue with permissions you must use the below command
sudo gem uninstall cocoapods -n /usr/local/bin