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

Do you need sudo to install ruby on cocoapods?


Asked by Whitley Velez on Dec 01, 2021 Ruby



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.
Next,
CocoaPods is built with Ruby and it will be installable with the default Ruby available on macOS. You can use a Ruby Version manager, however we recommend that you use the standard Ruby available on macOS unless you know what you're doing. Using the default Ruby install will require you to use sudo when installing gems.
Just so, Using the default Ruby install will require you to use sudo when installing gems. (This is only an issue for the duration of the gem installation, though.) If you encounter any problems during installation, please visit this guide.
Additionally,
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 this manner,
CocoaPods is not compatible with MacRuby. If you get the error "ERROR: While executing gem ... (Errno::EPERM); Operation not permitted - /usr/bin/fuzzy_match" then try: $ sudo gem install -n /usr/local/bin cocoapods Use the Xcode workspace <Project>.xcworkspace, not the Xcode project.