Troubleshooting CocoaPods Installation Error on MacOS Catalina

If you’re encountering an error related to ffi while installing CocoaPods on macOS Catalina, you can follow these steps to resolve the issue.

Step 1: Install FFI with a specific version**

1
sudo gem install ffi -v '1.10.0'

Step 2: Install CocoaPods**

1
sudo gem install cocoapods -n /usr/local/bin

Step 3: Install CocoaPods Binary**

1
sudo gem install cocoapods-binary

If you’re still facing issues after following the above steps, you can try uninstalling all gems and then reinstalling CocoaPods. Here’s how you can do it:

Step 4: Uninstall all gems**

1
sudo gem list --no-version | xargs -L 1 sudo gem uninstall -n /usr/local/bin -ax

After running the above command, you’ll be prompted to uninstall each gem individually. Press y and hit Enter for each prompt.

Once you have uninstalled all gems, proceed to reinstall CocoaPods using Step 2 mentioned earlier.

This should help resolve the ffi error and allow you to successfully install and use CocoaPods on macOS Catalina.

Note: Make sure you have Xcode and its command-line tools installed on your system before proceeding with the above steps.

0%