Cocoapods installation failed, Failed to build gem native extension Cocoapods installation failed, Failed to build gem native extension ruby ruby

Cocoapods installation failed, Failed to build gem native extension


I fixed it by running

brew install cocoapods

AndYou may want to remove it:

rm '/usr/local/bin/pod'

To force the link and overwrite all conflicting files:

brew link --overwrite cocoapods

Install homebrew if you haven't already. https://brew.sh/


Try adding --disable-system-libffi to the gem install command.

This worked for me:

gem inst cocoapods -- --disable-system-libffi


These lines of code can help to install any pods to your project on a Macbook M1.

sudo arch -x86_64 gem install ffiarch -x86_64 pod install