Today, I tried to setup a project that is using
bootstrap gem, which got dependency for
ffi. And when I tried to do
bundle install , I got following error:
Function.c:852:17: error: implicit declaration of function 'ffi_prep_closure_loc' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
ffiStatus = ffi_prep_closure_loc(code, &fnInfo->ffi_cif, callback_invoke, closure, code);
Function.c:852:17: note: did you mean 'ffi_prep_closure'?
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/ffi/ffi.h:269:1: note: 'ffi_prep_closure' declared here
1 error generated.
make: *** [Function.o] Error 1make failed, exit code 2
Did a quick search online, and found a temporary solution from this issue:
dyld: Symbol not found: _ffi_prep_closure_loc on Macos 10.14 · Issue #791 · ffi/ffi
Steps to reproduce: Create new rails app (I tried with ruby 2.6.1 and 2.6.5 and rails 6 and latest release) Create a…
gem install ffi -- --disable-system-libffi
Turns out ffi-1.13.1 is using
system-libffi for Mac doesn’t have that function.