zoukankan      html  css  js  c++  java
  • Cocoapods升级报错Error installing cocoapods: Failed to build gem native extension

    很长一段时间未用cocoapods,更新不了最新的三方库,要求升级cocoapods。

    1、升级Ruby环境

    sudo gem update --system
    

    2、更新cocoapods

    sudo gem install -n /usr/local/bin cocoapods
    

    结果报错:

    Building native extensions. This could take a while...
    ERROR:  Error installing cocoapods:
        ERROR: Failed to build gem native extension.
    
        current directory: /Library/Ruby/Gems/2.3.0/gems/ffi-1.12.2/ext/ffi_c
    /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -r ./siteconf20200309-13044-14m1r7i.rb extconf.rb
    mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/include/ruby.h
    
    extconf failed, exit code 1
    
    Gem files will remain installed in /Library/Ruby/Gems/2.3.0/gems/ffi-1.12.2 for inspection.
    Results logged to /Library/Ruby/Gems/2.3.0/extensions/universal-darwin-18/2.3.0/ffi-1.12.2/gem_make.out
    

    各种查资料,折腾一天 ,终于解决:

    open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
    

    安装成功后继续运行:

    sudo gem install -n /usr/local/bin cocoapods
    Building native extensions. This could take a while...
    Successfully installed ffi-1.14.2
    Successfully installed ethon-0.12.0
    Successfully installed typhoeus-1.4.0
    Successfully installed public_suffix-4.0.6
    Successfully installed concurrent-ruby-1.1.8
    Successfully installed addressable-2.7.0
    Successfully installed activesupport-5.2.4.5
    Successfully installed cocoapods-core-1.10.1
    Successfully installed cocoapods-1.10.1
    Parsing documentation for ffi-1.14.2
    Installing ri documentation for ffi-1.14.2
    Parsing documentation for ethon-0.12.0
    Installing ri documentation for ethon-0.12.0
    Parsing documentation for typhoeus-1.4.0
    Installing ri documentation for typhoeus-1.4.0
    Parsing documentation for public_suffix-4.0.6
    Installing ri documentation for public_suffix-4.0.6
    Parsing documentation for concurrent-ruby-1.1.8
    Installing ri documentation for concurrent-ruby-1.1.8
    Parsing documentation for addressable-2.7.0
    Installing ri documentation for addressable-2.7.0
    Parsing documentation for activesupport-5.2.4.5
    Installing ri documentation for activesupport-5.2.4.5
    Parsing documentation for cocoapods-core-1.10.1
    Installing ri documentation for cocoapods-core-1.10.1
    Parsing documentation for cocoapods-1.10.1
    Installing ri documentation for cocoapods-1.10.1
    Done installing documentation for ffi, ethon, typhoeus, public_suffix, concurrent-ruby, addressable, activesupport, cocoapods-core, cocoapods after 35 seconds
    9 gems installed
    

    搞定

  • 相关阅读:
    【CV论文阅读】Detecting events and key actors in multi-person videos
    2020意大利数学奥林匹克 第6题
    2020最终数学杯 初级组第3题
    地球上的最短距离
    钱学森做过的趣题
    第35届IMO预选题(瑞典提供)
    第55届IMO 第2题
    第四十届(1999年)IMO 第3题(白俄罗斯供题)
    2019年多瑙河数学竞赛(高中组) 第三题
    2020环球城市春季赛 O级别 高级组 第2题
  • 原文地址:https://www.cnblogs.com/crane13/p/14439514.html
Copyright © 2011-2022 走看看