Error installing cocoapods "sudo gem install cocoapods" MacOs Catalina
Asked Answered
G

4

10

I am trying to install cocoapods in my mac system but Unfortunately not able to install due to below error.

I have already used below commands.

  • sudo gem install -n /usr/local/bin cocoapods --pre

  • export GEM_HOME=~/.gems export PATH=$GEM_HOME/bin:$PATH gem install cocoapods

enter image description here

Gloria answered 3/4, 2020 at 9:16 Comment(0)
M
6

Seems like you don't have access to usr/bin directory. i have been there!!

please try below command.

sudo gem install -n /usr/local/bin cocoapods

this should work. Thanks!!

Please refer this post more information about access rights.

Mind answered 4/4, 2020 at 11:9 Comment(0)
S
4

I think you don't have the commande lines tool on Xcode...

sudo xcode-select --reset
xcode-select --install

Keep us posted...

Simonson answered 3/4, 2020 at 9:23 Comment(5)
I have tried command xcode-select --install but getting this error "xcode-select: error: command line tools are already installed, use "Software Update" to install updates"Gloria
Install directly from Apple Dev Center then : developer.apple.com/download/moreSimonson
Okay doing that.Gloria
This worked. After that tried again “sudo gem install cocoapods" and all works.Shrewsbury
I was able to get Cocoapods installed on my M1 chipset MacBook Air with these commands and putting into the user bin folder. You all rock!! 🤘Tamanaha
L
0

I had the same error, my problem was that ruby version 2.6.0 is the default version on mac os. so i installed rbenv

and set ruby to version 3.0.3 now it works

Lyonnais answered 12/1, 2022 at 12:14 Comment(0)
C
-1

Run the following on terminal:

brew install cocoapods

If you don't have Homebrew yet, run this:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Corolla answered 10/1, 2021 at 14:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.