The fastest and easy way to install Cocoapods in MacOs (Tested in High Sierra, Mojave, Catalina & Big Sur)
I browsed on the internet, and I found in several websites the most recommendable command:
sudo gem install cocoapods
But it didn’t work, so I continued browsing, and I found some people made it works with:
sudo gem install -n /usr/local/bin cocoapods
But it didn’t work for me either.
So, I returned to continue with my search. I wasn’t going to stop until I achieved it, And I did it! After wasting several hours trying and trying different commands unsuccessfully.
I’m writing this post to save you some hours looking for a solution to install cocoapods in your Mac and remind me in the future of The fastest and easy way to install Cocoapods in MacOs.
The trick is using Brew:
brew install cocoapods
With that, cocoapods is installed in your Mac, but that is not to all. The final step is to disperse the pod command to the entire command line, and we do with:
brew link cocoapods
And that’s it! Now you can use:
pod --version