简体   繁体   中英

Error installing cocoapods "sudo gem install cocoapods" MacOs Catalina

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

在此处输入图像描述

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

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

Keep us posted...

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.

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)"

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM