2

I am trying to install CocoaPods on my Mac. When i run this command:

sudo gem install cocoapods

it returns this:

Fetching: cocoapods-core-1.5.3.gem (100%)
Successfully installed cocoapods-core-1.5.3

ERROR:  Error installing cocoapods: invalid gem: package metadata is missing in /Library/Ruby/Gems/2.3.0/cache/cocoapods-deintegrate-1.0.2.gem

What is casing this issue and how do I install CocoaPods?

  • What is your question? What have you already tried to solve the problem? Can you install other gems without problems? – nohillside Aug 12 '18 at 9:18
  • Not installed so far - @ nohillside – Mahdi Bashirpour Aug 12 '18 at 9:26
2

I'd recommend using Homebrew to install CocoaPods.

If you are not already using Homebrew, it is a package manager for macOS, hugely popular among developers of all types. It makes installing packages like CocoaPods hassle free.

To install Homebrew, follow the instructions on the homepage

Paste that at a Terminal prompt.

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Homebrew requires Xcode Command Line Tools to be installed and setup (which I am assuming you already have as you are trying to install CocoaPods, implying you are developing for iOS).

Once Homebrew is setup, simply run:

brew install cocoapods

to install CocoaPods.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .