Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Do you have to use sudo to install cocoapods?


Asked by Travis Prince on Dec 01, 2021 FAQ



If you originally installed the cocoapods gem using sudo, you should use that command again. Later on, when you're actively using CocoaPods by installing pods, you will be notified when new versions become available with a CocoaPods X.X.X is now available, please update message.
Likewise,
Using the default Ruby install can require you to use sudo when installing gems. Further installation instructions are in the guides. Search for pods (above). Then list the dependencies in a text file named Podfile in your Xcode project directory: Tip: CocoaPods provides a pod init command to create a Podfile with smart defaults.
Just so, To update CocoaPods you simply install the gem again. $ [sudo] gem install cocoapods. Or for a pre-release version. $ [sudo] gem install cocoapods --pre. If you originally installed the cocoapods gem using sudo, you should use that command again.
In fact,
Tip: CocoaPods provides a pod init command to create a Podfile with smart defaults. You should use it. Sometimes CocoaPods doesn’t yet have a pod for one of your dependencies. Fortunately, creating a pod is pretty easy: You can find a lot of information on the process in the guides.
Next,
If you’re installing Cocoapods as a gem or with Homebrew, it installs as usual, but you get an error related to the ffi gem because this gem doesn’t compile under M1 for now. The solution is to install the Intel version that works perfectly via Rosetta 2: