Knowing how to completely uninstall CocoaPods from a Mac can be incredibly useful, especially if you are installing a new version version and want a clean start. Considering this application level dependency manager can be so important for managing external libraries, knowing how to properly remove it to install a fresh copy can be vital for certain users.
If simply uninstalling CocoaPods by dragging and dropping the app into your Trash and emptying it doesn’t cut the mustard, there are a couple of things you can try. Additionally, the solutions below are also helpful if you have multiple versions of the software that you need to remove.
How to CocoaPods From a Mac
1. Remove CocoaPods Using Mac Terminal
For this solution, you’re going to be using Terminal. It can typically be found in your Utilities folder, but you can also find the program through a Spotlight Search in the menu bar. There are a couple of commands you will need to know, so let’s take a quick look.
Time needed: 5 minutes
To fully uninstall CocoaPods from a Mac, follow these steps:
- First, open Terminal.
- With Terminal open, enter the following command to see which version(s) of CocoaPods is on your device:
gem list --local | grep cocoapods
- You will get an output similar to this, which shows you which versions you have installed within the parenthesis:
cocoapods (1.15.2, 0.20.2)
cocoapods-core (1.15.2, 0.20.2)
cocoapods-downloader (1.15.2, 0.1.2)
. - Enter the following commands one at a time to uninstall CocoaPods:
sudo gem uninstall cocoapods
sudo gem uninstall cocoapods-core
sudogem uninstall cocoapods-downloader
- You can also uninstall specific versions through the following command. Replace the Xs with your version number:
sudo
gem uninstall cocoapods -v
X.
XX.
X - You can repeat step two to see if these commands removed CocoaPods from your Mac.
- You can also remove any residual files from your home directory with the following command:
sudo rm -rf ~/.cocoapods
Hopefully these solutions work for you. You may also want to know how to completely uninstall PostgreSQL on your Mac.