I tried to update the cocoa pods, but facing an issue while updating(xcode12, macOS Catalina 10.15.5). please help. I have also attached a screenshot of my terminal.
Thanks in advance!!
Asked
Active
Viewed 3.4k times
11

subhangi pawar
- 451
- 2
- 7
- 16
-
1There are a lot of solutions but after we got a similar error, in one case this fixed it `sudo gem install -n /usr/local/bin cocoapods`. Then the other case was to totall remove cocoapods and then reinstall. So `sudo gem uninstall cocoapods` then `gem install cocoapods` – Jay Dec 11 '20 at 19:04
-
@Jay I have uninstalled cocoapods and then again tried to install coaoapods, getting the same error – subhangi pawar Jan 05 '21 at 05:10
-
1Try it with brew. `brew cleanup -d -v ` and then `brew install cocoapods ` – Jay Jan 05 '21 at 19:22
-
4**DO NOT post images of code, data, error messages, etc.** - copy or type the text into the question. [ask] – Rob Feb 06 '21 at 11:07
3 Answers
26
I solved the above problem by updating the ruby to the latest version(3.0.0) using the following command in the terminal:
Check the version of Ruby installed on your Mac
ruby -v
Install the Ruby Version Manager rvm
curl -L https://get.rvm.io | bash -s stable
Once this command has finished running you need to restart your terminal for rvm to be recognised.
Install the latest version of Ruby
rvm install ruby-[version]
(or)
rvm install ruby --latest
Install cocoapods
sudo gem install cocoapods pod setup

pkamb
- 33,281
- 23
- 160
- 191

subhangi pawar
- 451
- 2
- 7
- 16
-
1
-
ruby took about 20mn to install - and then the pods worked like a charm! Thank you! – Antoine Neidecker Oct 12 '21 at 18:28
23
Please try to upgrade via brew:
brew upgrade cocoapods

Cody Gray - on strike
- 239,200
- 50
- 490
- 574

Gustavo Silva
- 243
- 2
- 4
-
2"gem which cocoapods" - to check which version of cocoapods is installed. "sudo gem install cocoapods" - to update cocoapods "sudo xcode-select -s /Library/Developer/CommandLineTools/" - if there are several Xcode tools installed – Naloiko Eugene Oct 20 '21 at 12:26
0
you need to install Xcode Developer Tools first, as mentioned in your error message.
to install Developer Tools, open a Terminal and execute xcode-select --install
command.

BoygeniusDexter
- 2,154
- 1
- 16
- 14
-
getting the same error after installing Xcode Developer Tool. Is there any Ruby issue? please refer to the screenshot attached above. – subhangi pawar Dec 09 '20 at 06:55
-
you could try to install it using `brew`. 1. install `brew`, if you don't have it installed: https://brew.sh/ 2. execute `brew install cocoapods` – BoygeniusDexter Dec 09 '20 at 09:39