I haven’t used Cocoapods for a long time. I can’t update the latest third-party library and need to upgrade Cocoapods.

1. Upgrade the Ruby environment

sudo gem update --system
Copy the code

2. Update Cocoapods

sudo gem install -n /usr/local/bin cocoapods
Copy the code

Result error:

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, The exit code 1 Gem files will remain installed in/Library/Ruby/Gems / 2.3.0 / Gems/ffi - 1.12.2 for inspection. The Results logged To/Library/Ruby/Gems / 2.3.0 / extensions/universal - Darwin - 18/2.3.0 ffi - 1.12.2 / gem_make. OutCopy the code

All kinds of information, toss all day, finally solved:

The open/Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10. 14. PKGCopy the code

Continue running after successful installation:

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 Freemarkerdocumentation for FFI-1.14.2 Installing ri Documentation for FFI-1.14.2 Parsing For ethon-0.12.0 Installing RI documentation for ethon-0.12.0 Parsing for typhoon EUS-1.4.0 Installing RI Documentation for typhoon EUS -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 Cocoapods-1.10.1 Done Installing ri documentation for FFI, ethon, typhoeus, public_suffix, concurrent-ruby, addressable, activesupport, cocoapods-core, cocoapods after 35 seconds 9 gems installedCopy the code

Done!