Search code examples
xcodeshellterminalsdkcocoapods

I cannot install Cocapods in my MacBook Pro


When I try to install cocoa pods, I see this error. I'm using macOS Catalina version 10.15.7. I get this error when I use "sudo gem install cocoapods"

enter image description here


Solution

  • This worked for me. My issue has been resolved. Error: gem native extension error while installing cocoapods

    Answer: Follow below 3 Steps issue will be fixed.

    Step 1: Open XCode go to below path

    XCode > Preferences > Locations > Command Line Tools (select-Xcode)

    Step 2: Open Terminal- Paste the below Command

    curl -L https://get.rvm.io | bash -s stable

    Reopen Terminal -Paste the below Commands

    Note: It will take 3-5 minutes

    rvm install ruby-2.6

    rvm use ruby-2.6.3

    rvm --default use 2.6.3

    Step3:

    Open Terminal- Type below Command

    sudo gem install cocoapods

    Now gem native extension error while installing cocoapods will not come

    Issue resolved.