Error installing CocoaPods - macOS BigSur

I had the same issue (Catalina 10.15.7 & Xcode 12.3).

I used homebrew instead of the gem:

brew install cocoapods

XCode's ruby framework appears to have a problem. Reinstall cleanly with the latest version and running xcode-select --install or --select did not work for me.

This is how I managed to make it run with XCode 12.2 and Catalina (10.15.7):


cd /Applications/
ln -sf ../../../../Headers/ruby/config.h

cd /Applications/
ln -sf universal-darwin20 universal-darwin19

(edit fixed typo in symlink)