Skip to content

Instantly share code, notes, and snippets.

@cbertelegni
Created February 18, 2015 20:10
Show Gist options
  • Save cbertelegni/6421d81a4f3994520f95 to your computer and use it in GitHub Desktop.
Save cbertelegni/6421d81a4f3994520f95 to your computer and use it in GitHub Desktop.
Error with Nekogiri gem on Ubuntu 14.04

Error in bundle update on Ubuntu 14.04: error occurred while installing nokogiri

Solution

gem install nokogiri -- \
    --use-system-libraries \
    --with-xml2-config=/usr/bin/xml2-config \
    --with-xslt-config=/usr/bin/xslt-config
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/home/cbertelegni/.rvm/rubies/ruby-1.9.2-p330/bin/ruby -r ./siteconf20150218-693-ntiav5.rb extconf.rb --use-system-libraries
*** 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/cbertelegni/.rvm/rubies/ruby-1.9.2-p330/bin/ruby
--help
--clean
/home/cbertelegni/.rvm/rubies/ruby-1.9.2-p330/lib/ruby/1.9.1/mkmf.rb:445:in `try_compile': wrong number of arguments (3 for 2) (ArgumentError)
from extconf.rb:77:in `block in add_cflags'
from /home/cbertelegni/.rvm/rubies/ruby-1.9.2-p330/lib/ruby/1.9.1/mkmf.rb:481:in `with_cflags'
from extconf.rb:76:in `add_cflags'
from extconf.rb:323:in `<main>'
checking if the C compiler accepts ...
extconf failed, exit code 1
Gem files will remain installed in /home/cbertelegni/.rvm/gems/ruby-1.9.2-p330/gems/nokogiri-1.6.4.1 for inspection.
Results logged to /home/cbertelegni/.rvm/gems/ruby-1.9.2-p330/extensions/x86_64-linux/1.9.1/nokogiri-1.6.4.1/gem_make.out
An error occurred while installing nokogiri (1.6.4.1), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.6.4.1'` succeeds before bundling.
/home/cbertelegni/.rvm/rubies/ruby-1.9.2-p330/bin/ruby -r ./siteconf20150218-31466-1gz8rqg.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.
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/cbertelegni/.rvm/rubies/ruby-1.9.2-p330/bin/ruby
--help
--clean
/home/cbertelegni/.rvm/rubies/ruby-1.9.2-p330/lib/ruby/1.9.1/mkmf.rb:445:in `try_compile': wrong number of arguments (3 for 2) (ArgumentError)
from extconf.rb:77:in `block in add_cflags'
from /home/cbertelegni/.rvm/rubies/ruby-1.9.2-p330/lib/ruby/1.9.1/mkmf.rb:481:in `with_cflags'
from extconf.rb:76:in `add_cflags'
from extconf.rb:323:in `<main>'
checking if the C compiler accepts ...
extconf failed, exit code 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment