Nokogiri: install nokogiri-1.6.7.2 + ruby-2.3.0

Created on 8 Feb 2016  路  2Comments  路  Source: sparklemotion/nokogiri

HI

I am using ruby-2.3.0 and trying to install nokogiri. I am getting following error:

Building native extensions. This could take a while...
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.

current directory: /home/account/.rvm/gems/ruby-2.3.0@latest/gems/nokogiri-1.6.7.2/ext/nokogiri

/home/account/.rvm/rubies/ruby-2.3.0/bin/ruby -r ./siteconf20160208-14597-b0hj2y.rb extconf.rb
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/account/.rvm/rubies/ruby-2.3.0/bin/$(RUBY_BASE_NAME)
--help
--clean
/home/account/.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/account/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/mkmf.rb:571:inblock in try_compile'
from /home/account/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/mkmf.rb:522:in with_werror' from /home/account/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/mkmf.rb:571:intry_compile'
from extconf.rb:80:in nokogiri_try_compile' from extconf.rb:87:inblock in add_cflags'
from /home/account/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/mkmf.rb:629:in with_cflags' from extconf.rb:86:inadd_cflags'
from extconf.rb:336:in `

'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

/home/account/.rvm/gems/ruby-2.3.0@latest/extensions/x86_64-linux/2.3.0/nokogiri-1.6.7.2/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /home/account/.rvm/gems/ruby-2.3.0@latest/gems/nokogiri-1.6.7.2 for inspection.
Results logged to /home/account/.rvm/gems/ruby-2.3.0@latest/extensions/x86_64-linux/2.3.0/nokogiri-1.6.7.2/gem_make.out

All 2 comments

Hi,

Thanks for asking this question. I noticed this message in your output:

You have to install development tools first.

which tells me that you may not have one or more prerequisites installed for compiling Ruby C extensions (which are not specific to Nokogiri).

Please follow the instructions at http://www.nokogiri.org/tutorials/installing_nokogiri.html and let us know how you get on.

If you're still having problems, please make sure to include your output as well as all your logs, especially mkmf.log, when you comment on this issue and we'll reopen if necessary.

-m

xcode-select --install to install the development tools.

Was this page helpful?
0 / 5 - 0 ratings