Can't Install ffi -v '1.9.18' on macos Catalina
To get past that error, install ffi using:
gem install ffi -v '1.9.18' -- --with-cflags="-Wno-error=implicit-function-declaration"
Error installing ffi. Faild to build native Extention
There is this line in the error message:
You have to install development tools first.
Please ensure that you have XCode
and the Xcode Command Line Tools
installed. Please open XCode
at least once to accept the licence agreement.
Installing ffi 1.12.2 with native extensions FAILED
The relevant error in your log is:
/bin/sh: /Applications/Xcode: No such file or directory
This is caused by:
clang: error: no input files
cd "/Users/myuser/.gem/gems/ffi-1.12.2/ext/ffi_c/libffi-x86_64-darwin18" && /Applications/Xcode 10_3.app/Contents/Developer/usr/bin/make
The makefile for ffi
probably doesn't support spaces in the command-line tool's path. You should rename your Xcode name and make sure xcode-select -p
points to the updated path without spaces.
This answer might not be relevant to you anymore, but it took me quite some time to notice this in the log. I'm posting so that anyone with the same issue stumbling on this question can find an answer!
Can't install `ffi -v 1.12.2` on mac OS Monterey
I have the same issue on M1 with ffi 1.15.5
and it works if I do:
gem install ffi -v '1.15.5' -- --with-cflags=-Wno-implicit-function-declaration
Same thing goes for ffi 1.12.2
.
As far as I understand it (don't know C and googled this) - When C doesn’t find a function, it assumes it is implicitly declared and errors out. --with-cflags=-Wno-implicit-function-declaration
tells the compiler to ignore any functions that are implicitly declared.
Related Topics
Confusion With Atomic Grouping - How It Differs from the Grouping in Regular Expression of Ruby
Converting String from Snake_Case to Camelcase in Ruby
Ruby - Net/Http - Following Redirects
How to Avoid Nomethoderror For Nil Elements When Accessing Nested Hashes
Exporting an Environment Variable in Ruby
Undefined Method Raise_In_Transactional_Callbacks=' for Activerecord::Base:Class (Nomethoderror)
Rails Browser Detection Methods
Ruby: Easiest Way to Filter Hash Keys
Ruby Method Lookup Path For an Object
How to Get Filename Without Extension from File Path in Ruby
List of Ruby Operators That Can Be Overridden/Implemented
How to Create a Class Instance from a String Name in Ruby
How to Search a Folder and All of Its Subfolders For Files of a Certain Type