Hello, I'm having issues to compile Nokogiri. I've already went through the installation tutorial on Nokogiri website and dozens of stack exchange questions and other sites, but none of them seemed to fix my problem, so i decided to come here for help, I'm sorry if I am being ignorant of something.
I'm using rvm and ruby-2.3.0 as default.
Here's the compiling error:
$ gem install nokogiri
Building native extensions. This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
current directory: /home/matheus/.rvm/gems/ruby-2.3.0/gems/nokogiri-1.6.8/ext/nokogiri
/home/matheus/.rvm/rubies/ruby-2.3.0/bin/ruby -r ./siteconf20160711-8981-g9imhg.rb extconf.rb
Using pkg-config version 1.1.7
checking if the C compiler accepts ... *** 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=/home/matheus/.rvm/rubies/ruby-2.3.0/bin/$(RUBY_BASE_NAME)
--help
--clean
/home/matheus/.rvm/rubies/ruby-2.3.0/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/matheus/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/mkmf.rb:571:in `block in try_compile'
from /home/matheus/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/mkmf.rb:522:in `with_werror'
from /home/matheus/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/mkmf.rb:571:in `try_compile'
from extconf.rb:138:in `nokogiri_try_compile'
from extconf.rb:162:in `block in add_cflags'
from /home/matheus/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/mkmf.rb:629:in `with_cflags'
from extconf.rb:161:in `add_cflags'
from extconf.rb:414:in `<main>'
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/home/matheus/.rvm/gems/ruby-2.3.0/extensions/x86_64-linux/2.3.0/nokogiri-1.6.8/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /home/matheus/.rvm/gems/ruby-2.3.0/gems/nokogiri-1.6.8 for inspection.
Results logged to /home/matheus/.rvm/gems/ruby-2.3.0/extensions/x86_64-linux/2.3.0/nokogiri-1.6.8/gem_make.out
Here's the mkmf.log:
"gcc -o conftest -I/home/matheus/.rvm/rubies/ruby-2.3.0/include/ruby-2.3.0/x86_64-linux -I/home/matheus/.rvm/rubies/ruby-2.3.0/include/ruby-2.3.0/ruby/backward -I/home/matheus/.rvm/rubies/ruby-2.3.0/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/matheus/.rvm/rubies/ruby-2.3.0/lib -Wl,-R/home/matheus/.rvm/rubies/ruby-2.3.0/lib -L. -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,-rpath,'/../lib' -Wl,-R'/../lib' -lruby -lpthread -lgmp -ldl -lcrypt -lm -lc "
gcc: error trying to exec 'cc1': execvp: No such file or directory
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5: return 0;
6: }
/* end */
Thanks!