How To Fix The FFI (Foreign Function Interface) Load Error That Can Occur When Using Pod Installation

How to fix the "LoadError - dlopen(/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.5/lib/ffi_c.bundle, 0x0009): tried: '/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.5/lib/ffi_c.bundle' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.5/lib/ffi_c.bundle' (no such file), '/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.5/lib/ffi_c.bundle' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')) - /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.5/lib/ffi_c.bundle" error.

This error is common on arm64 Macs. It occurs when you try to run a Ruby program that uses the FFI gem, but the FFI gem is not installed for the correct architecture.

To fix this error, follow these steps:

  1. Uninstall the ffi gem using the following command:
sudo gem uninstall ffi
  1. Reinstall the ffi gem using the following command:
sudo gem install ffi

Once you have reinstalled the ffi gem, you should be able to run your Ruby program without the error.

Here is an example of how to use the commands above:

$ sudo gem uninstall ffi
Password:
Successfully uninstalled gem ffi-1.15.5

$ sudo gem install ffi
Successfully installed gem ffi-1.15.6

If you are still having trouble, you can try searching for help online or asking for help from a Ruby expert.

Comments

Popular posts from this blog

How To Check If Your Android Phone Is Official Or Rooted

Android Reverse Engineering - Beginners Guide To Smali Coding

Conquering macOS Upgrades: A Guide for iOS App Developers