sudo gem install ffi -v '1.12.2' --source 'https://rubygems.org/'
Here are the errors:
/usr/bin/libtool -static -o "/Library/Ruby/Gems/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi-universal-darwin20"/.libs/libffi_convenience.a \
"/Library/Ruby/Gems/2.6.0/gems/ffi-1.12.2/ext/ffi_c"/libffi-x86_64/.libs/libffi_convenience.a
rm -f "/Library/Ruby/Gems/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi-universal-darwin20"/include/ffi.h
compiling AbstractMemory.c
In file included from AbstractMemory.c:47:
In file included from ./AbstractMemory.h:42:
In file included from ./Types.h:79:
./Type.h:50:5: error: unknown type name 'ffi_type'
ffi_type* ffiType;
^
In file included from AbstractMemory.c:49:
In file included from ./Function.h:48:
./Call.h:93:5: error: unknown type name 'ffi_cif'
ffi_cif cif;
^
In file included from AbstractMemory.c:49:
./Function.h:59:5: error: unknown type name 'ffi_type'
ffi_type* ffiReturnType;
^
./Function.h:60:5: error: unknown type name 'ffi_type'
ffi_type** ffiParameterTypes;
^
./Function.h:61:5: error: unknown type name 'ffi_cif'
ffi_cif ffi_cif;
^
./Function.h:66:5: error: unknown type name 'ffi_abi'
ffi_abi abi;
^
6 errors generated.
make: *** [AbstractMemory.o] Error 1
make failed, exit code 2