2022 Nov Update
If you can use Homebrew to manage cocoapods.
# Uninstall the local cocoapods gem
sudo gem uninstall cocoapods
# Reinstall cocoapods via Homebrew
brew install cocoapods
2021 Solution
# STEP 1: Install ffi
sudo arch -x86_64 gem install ffi
# STEP 2: Re-install dependencies
arch -x86_64 pod install
Additional Information
#1 For anyone seeing the arch: posix_spawnp: gem: Bad CPU type in executable
error, you must first install Rosetta. Thanks, @Jack Dewhurst
#2 If you run pod
commands pretty often, setting up an alias in .zshrc
or .bash_profile
might be handy. Thanks, @theMoonlitKnight for the suggestion.
alias pod='arch -x86_64 pod'
60