Skip to content

Instantly share code, notes, and snippets.

@parshap
Created December 4, 2013 10:52
Show Gist options
  • Save parshap/7785714 to your computer and use it in GitHub Desktop.
Save parshap/7785714 to your computer and use it in GitHub Desktop.
Ruby native extension error on SmartOS when `gem install ffi`
/usr/local/bin/ruby extconf.rb
checking for ffi.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/local/bin/ruby
--with-ffi_c-dir
--without-ffi_c-dir
--with-ffi_c-include
--without-ffi_c-include=${ffi_c-dir}/include
--with-ffi_c-lib
--without-ffi_c-lib=${ffi_c-dir}/
--with-libffi-config
--without-libffi-config
--with-pkg-config
--without-pkg-config
/usr/local/lib/ruby/2.0.0/mkmf.rb:434:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /usr/local/lib/ruby/2.0.0/mkmf.rb:565:in `try_cpp'
from /usr/local/lib/ruby/2.0.0/mkmf.rb:1044:in `block in have_header'
from /usr/local/lib/ruby/2.0.0/mkmf.rb:895:in `block in checking_for'
from /usr/local/lib/ruby/2.0.0/mkmf.rb:340:in `block (2 levels) in postpone'
from /usr/local/lib/ruby/2.0.0/mkmf.rb:310:in `open'
from /usr/local/lib/ruby/2.0.0/mkmf.rb:340:in `block in postpone'
from /usr/local/lib/ruby/2.0.0/mkmf.rb:310:in `open'
from /usr/local/lib/ruby/2.0.0/mkmf.rb:336:in `postpone'
from /usr/local/lib/ruby/2.0.0/mkmf.rb:894:in `checking_for'
from /usr/local/lib/ruby/2.0.0/mkmf.rb:1043:in `have_header'
from extconf.rb:16:in `<main>'
package configuration for libffi is not found
"gcc -o conftest -I/usr/local/include/ruby-2.0.0/x86_64-solaris2.11 -I/usr/local/include/ruby-2.0.0/ruby/backward -I/usr/local/include/ruby-2.0.0 -I. -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -std=c99 conftest.c -L. -L/usr/local/lib -Wl,-R/usr/local/lib -L. -fstack-protector -Wl,-R -Wl,/usr/local/lib -L/usr/local/lib -lruby-static -lpthread -lrt -lsocket -ldl -lcrypt -lm -lc"
In file included from /usr/local/include/ruby-2.0.0/ruby/ruby.h:1567:0,
from /usr/local/include/ruby-2.0.0/ruby.h:33,
from conftest.c:1:
/usr/local/include/ruby-2.0.0/ruby/missing.h:212:17: error: expected identifier or '(' before '__extension__'
/usr/local/include/ruby-2.0.0/ruby/missing.h:212:17: error: expected identifier or '(' before ')' token
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5: return 0;
6: }
/* end */
@johnknott
Copy link

Did you ever get this sorted ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment