Macos: How to Solve cocoapods Install Error

Executing “sudo gem install -n /usr/local/bin cocoapods” gave me an error: “Failed to build gem native extension”.
Followed the online method, confirmed the ruby version 2.6.3, and installed rvm also reported an error (443 error), in short, tried everything I could find on stackoverflow

The final solution: specify a lower version when installing cocoapods: sudo gem install cocoapods
sudo gem install cocoapods -v 1.8.4

Directly solved.

Read More: