The React Native docs recommend installing Cocoapods with sudo gem install cocoapods
, but I'm used to using Homebrew and have seen elsewhere that people install it with brew install cocoapods
. When I try installing it with Homebrew, I get this warning:
Warning: Treating cocoapods as a formula. For the cask, use homebrew/cask/cocoapods
What I Want To Know:
What's the difference, if any, between installing Cocoapods with sudo gem install cocoapods
and with brew install cocoapods
If I install it with Homebrew, should I install the regular package or the cask? What's the difference?
0. CocoaPods manages library dependencies for your Xcode project. You specify the dependencies for your project in one easy text file. CocoaPods resolves dependencies between libraries, fetches source code for the dependencies, and creates and maintains an Xcode workspace to build your project.
macOS comes with a pre-installed version of Ruby. If you try to install a gem through pre-installed Ruby, you've to use sudo
by default witch is not a good practice.
Another option is to install CocoaPods in your user-level directory by following instructions available on the Sudo-less installation section.
I would suggest you install CocoaPods using brew
. It's a little cleaner option and you can update it easier.
The cocoapods
cask is for CocoaPads App and the formula is for the CLI only version.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With