各种 google、bing,就是没找到解决方法,所以来求助各位了
操作系统:ubuntu 16.04 ruby 环境:2.3.3p222 [x86_64-linux] 报错信息:
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /home/winse/.rvm/gems/ruby-2.3.3/gems/ffi-1.9.14/ext/ffi_c
/home/winse/.rvm/rubies/ruby-2.3.3/bin/ruby -r ./siteconf20161224-5954-jxwijc.rb extconf.rb
*** 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.
/home/winse/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable
file. (RuntimeError)
You have to install development tools first.
from /home/winse/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/mkmf.rb:541:in `try_link0'
from /home/winse/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/mkmf.rb:556:in `try_link'
from /home/winse/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/mkmf.rb:657:in `try_ldflags'
from /home/winse/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/mkmf.rb:1813:in `pkg_config'
from extconf.rb:15:in `<main>'
log:
"pkg-config --exists libffi"
| pkg-config --libs libffi
=> "-lffi\n"
"gcc -o conftest -I/home/winse/.rvm/rubies/ruby-2.3.3/include/ruby-2.3.0/x86_64-linux -I/home/winse/.rvm/rubies/ruby-2.3.3/include/ruby-2.3.0/ruby/backward -I/home/winse/.rvm/rubies/ruby-2.3.3/include/ruby-2.3.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 -Wdeprecated-declarations -Wno-packed-bitfield-compat -Wno-maybe-uninitialized -fPIC conftest.c -L. -L/home/winse/.rvm/rubies/ruby-2.3.3/lib -Wl,-R/home/winse/.rvm/rubies/ruby-2.3.3/lib -L. -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,-R/home/winse/.rvm/rubies/ruby-2.3.3/lib -L/home/winse/.rvm/rubies/ruby-2.3.3/lib -lruby -lpthread -lgmp -ldl -lcrypt -lm -lc"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5: return 0;
6: }
/* end */