11

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!! enter image description here

subhangi pawar
  • 451
  • 2
  • 7
  • 16
  • 1
    There 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
  • 1
    Try 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 Answers3

26

I solved the above problem by updating the ruby to the latest version(3.0.0) using the following command in the terminal:

  1. Check the version of Ruby installed on your Mac

    ruby -v
    
  2. 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.

  3. Install the latest version of Ruby

    rvm install ruby-[version]
    

    (or)

    rvm install ruby --latest
    
  4. Install cocoapods

    sudo gem install cocoapods
    
    pod setup
    
pkamb
  • 33,281
  • 23
  • 160
  • 191
subhangi pawar
  • 451
  • 2
  • 7
  • 16
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