ERROR: Error installing cocoapods: ERROR: Failed to build gem native extension

后端 未结 23 1747
深忆病人
深忆病人 2020-12-04 19:06

I am trying to install cocoapods to my MacBook Pro running with OSX 10.9.1 (new Mavericks) and after type gem install cocoapods I get the following error:

相关标签:
23条回答
  • 2020-12-04 19:36

    You need to install Xcode's developer tools. The easiest way to do this is through terminal (this question)

    xcode-select --install
    
    0 讨论(0)
  • 2020-12-04 19:36

    I was getting this error and had to completely reinstall cocoapods to fix it. Finally worked. Maybe this solution suits for anyone else.

    sudo rm -rf home_folder/.cocoapods/
    

    After that, did again

    pod setup
    

    and installed my libraries from zero, and everything worked.

    Hope it helps!

    0 讨论(0)
  • 2020-12-04 19:37

    Worked for me in 2020 (Mac OS Catalina)

    xcode-select --install
    
    sudo gem install -n /usr/local/bin cocoapods
    
    0 讨论(0)
  • I had multiple environments in my configuration, which was causing problems as rvm was interfering with the installation. Once ruby 2.x was detected the install went fine.

    For my environment I did the following: 1. xcode-select --install 2. rvm implode (Note - too drastic - you may not need to do this, I didn't have any use for the older ruby installations, I removed them via rvm uninstall one-by-one and then used rvm implode 3. gem install cocoapods

    This time the last command worked without any issues.

    0 讨论(0)
  • 2020-12-04 19:40

    if you're also seeing error: active developer path .. does not exist you may also have to do this

    $ sudo xcode-select --reset
    
    0 讨论(0)
提交回复
热议问题