MAC OS X version 11.1, Xcode version 12.3

Sudo gem install Cocoapods Failed to install cocoapods

Partial error message:

ERROR: Error installing cocoapods: ERROR: Failed to build gem native extension. current directory: / Library/Ruby/Gems/server/Gems/ffi - 1.14.2 / ext/ffi_c/System/Library/Frameworks/Ruby framework Versions / 2.6 / usr/bin/Ruby - I/System/Library/Frameworks/Ruby framework Versions / 2.6 / usr/lib/Ruby/server - r. / siteconf20210104-11358 - ahylaa. Rb extconf.rb *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options.Copy the code

Execute this command

source ~/.zshrc

sudo gem install cocoapods
Copy the code

Installation succeeded, partial logs

Successfully installed ffi-1.14.2
Successfully installed ethon-0.12.0
Successfully installed typhoeus-1.4.0
Successfully installed netrc-0.11.0
Successfully installed public_suffix-4.0.6
Successfully installed addressable-2.7.0
Successfully installed cocoapods-core-1.10.0
Successfully installed claide-1.0.3
Successfully installed cocoapods-deintegrate-1.0.4
Successfully installed cocoapods-downloader-1.4.0
Successfully installed cocoapods-plugins-1.0.0
Successfully installed cocoapods-search-1.0.0
Successfully installed cocoapods-trunk-1.5.0
Successfully installed cocoapods-try-1.2.0
.........
Done installing documentation for ffi, ethon, typhoeus, netrc, public_suffix, addressable, cocoapods-core, claide, cocoapods-deintegrate, cocoapods-downloader, cocoapods-plugins, cocoapods-search, cocoapods-trunk, cocoapods-try, molinillo, atomos, colored2, nanaimo, xcodeproj, escape, fourflusher, gh_inspector, ruby-macho, cocoapods after 25 seconds
24 gems installed
Copy the code