RVM rvm 1.29.12-next
Mac OS Big Sur on M1 chip
rvm install 2.6.4
fails with:
Error running '__rvm_make -j8',
please read /Users/jason/.rvm/log/1626110300_ruby-2.6.4/make.log
There has been an error while running make. Halting the installation.
the makefile error is:
error: implicit declaration of function 'ffi_prep_closure' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
result = ffi_prep_closure(pcl, cif, callback, (void *)self);
this is caused by the environment flags not set in your shell.
brew info libffi
will tell you the variables you need:
For compilers to find libffi you may need to set: export LDFLAGS="-L/opt/homebrew/opt/libffi/lib" export CPPFLAGS="-I/opt/homebrew/opt/libffi/include"
For pkg-config to find libffi you may need to set: export PKG_CONFIG_PATH="/opt/homebrew/opt/libffi/lib/pkgconfig"
for ZSH, edit ~/.zshenv
and add:
export LDFLAGS="-L/opt/homebrew/opt/libffi/lib"
export CPPFLAGS="-I/opt/homebrew/opt/libffi/include"
export PKG_CONFIG_PATH="/opt/homebrew/opt/libffi/lib/pkgconfig"
Close & reopen your terminal window or source ~/.zshrc
to load your changes
Check your work with
% echo $LDFLAGS
-L/opt/homebrew/opt/libffi/lib
% echo $CPPFLAGS
-I/opt/homebrew/opt/libffi/include
% echo $PKG_CONFIG_PATH
/opt/homebrew/opt/libffi/lib/pkgconfig
(confirm that the environment variables are correct)
re-try to install the rvm version you want to install.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With