If you encounter an error related to “ffi” when trying to install CocoaPods on macOS Catalina, follow these steps to resolve the issue:
- Install ffi version 1.10.0:
1
|
sudo gem install ffi -v '1.10.0'
|
- Install CocoaPods:
1
|
sudo gem install cocoapods -n /usr/local/bin
|
- Install CocoaPods-binary:
1
|
sudo gem install cocoapods-binary
|
- If you still face issues after following the above steps, it’s recommended to uninstall all gems and then reinstall them:
1
|
sudo gem list --no-version | xargs -L 1 sudo gem uninstall -n /usr/local/bin -ax
|
Note: The command above will uninstall all gems from the default gem path. If you have gems installed in other locations, you may need to handle those manually.
After performing the steps above, you should be able to install and use CocoaPods without encountering the “ffi” error on macOS Catalina.