Learn Courses My Dashboard

Need Help? Installing errors while installing Cocoapods!

Hi there,

What I’m trying to do?
actually, I was installing cocoapods by the simple way, by which everyone going through to install like (sudo gem install cocoapods) via terminal, but I got the error, check out the attached image.

Did I find the solution?
after a lot of searching, I find the solution to this error, actually, I was using ruby by apple default for installing cocoapods so I have to create another ruby by the manager’s so I can install cocoapods - I try this but still, errors are coming after some step even this solution is perfectly working on everyone laptop.

And even (sudo gem install cocoapods) this is working for everyone to install cocoapods but why is not my machine.

I have MacBook Pro 2015 (13").

  • Version 10.15.7 (Catalina)

Should I reinstall macOS on my mac? Or please tell me the solution!

The simplest way to install cocoapods is to use HomeBrew as the installer.

Open Terminal and paste in this string to install HomeBrew.

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Then to install cocoapods, paste this command into Terminal.

brew install cocoapods

The same process applies if you have a Mac which has the M1 CPU.

I did this, but still errors are coming.

As the main user of the laptop, you should have administrator rights. To check that, open System Preferences and select the Users and Groups option.

On the left side of the window that opens, locate your account name in the list. If the word Admin is immediately below your account name, then you are an administrator on this machine.