Trying to install nokogiri on Mountain Lion. I was using ruby 1.8.7 but just upgraded to 1.9.3 but it stopped the bundle install from working.
Incidentally, I could get round this problem by uninstalling ruby 1.9.3 and reverting to 1.8.7. however this is obviously a suboptimal solution since I don't want to be stuck on 1.8.7 for the rest of time...
Users-MacBook-Pro:sample_app user$ ls
Gemfile app doc script
Gemfile.lock config lib spec
README.md config.ru log tmp
Rakefile db public vendor
Ravins-MacBook-Pro:sample_app user$ bundle
Fetching gem metadata from https://rubygems.org/.......
/Users/user/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.2.1/lib/bundler.rb:263: warning: Insecure world writable dir /usr/local in PATH, mode 040777
Using rake (0.9.2.2)
Using i18n (0.6.1)
Using multi_json (1.3.6)
Using activesupport (3.2.8)
Using builder (3.0.3)
Using activemodel (3.2.8)
Using erubis (2.7.0)
Using journey (1.0.4)
Using rack (1.4.1)
Using rack-cache (1.2)
Using rack-test (0.6.2)
Using hike (1.2.1)
Using tilt (1.3.3)
Using sprockets (2.1.3)
Using actionpack (3.2.8)
Using mime-types (1.19)
Using polyglot (0.3.3)
Using treetop (1.4.10)
Using mail (2.4.4)
Using actionmailer (3.2.8)
Using arel (3.0.2)
Using tzinfo (0.3.33)
Using activerecord (3.2.8)
Using activeresource (3.2.8)
Using addressable (2.3.2)
Installing nokogiri (1.5.5) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/user/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
extconf.rb:86: warning: Insecure world writable dir /usr/local in PATH, mode 040777
checking for libxml/parser.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=/Users/user/.rvm/rubies/ruby-1.9.3-p194/bin/ruby
--with-zlib-dir
--without-zlib-dir
--with-zlib-include
--without-zlib-include=${zlib-dir}/include
--with-zlib-lib
--without-zlib-lib=${zlib-dir}/lib
--with-iconv-dir
--without-iconv-dir
--with-iconv-include
--without-iconv-include=${iconv-dir}/include
--with-iconv-lib
--without-iconv-lib=${iconv-dir}/lib
--with-xml2-dir
--without-xml2-dir
--with-xml2-include
--without-xml2-include=${xml2-dir}/include
--with-xml2-lib
--without-xml2-lib=${xml2-dir}/lib
--with-xslt-dir
--without-xslt-dir
--with-xslt-include
--without-xslt-include=${xslt-dir}/include
--with-xslt-lib
--without-xslt-lib=${xslt-dir}/lib
--with-libxslt-config
--without-libxslt-config
--with-pkg-config
--without-pkg-config
--with-libxml-2.0-config
--without-libxml-2.0-config
--with-pkg-config
--without-pkg-config
--with-libiconv-config
--without-libiconv-config
--with-pkg-config
--without-pkg-config
/Users/user/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /Users/user/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:506:in `try_cpp'
from /Users/user/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:970:in `block in find_header'
from /Users/user/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for'
from /Users/user/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone'
from /Users/user/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /Users/user/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone'
from /Users/user/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /Users/user/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:280:in `postpone'
from /Users/user/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for'
from /Users/user/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:969:in `find_header'
from extconf.rb:114:in `<main>'
Gem files will remain installed in /Users/user/.rvm/gems/ruby-1.9.3-p194/gems/nokogiri-1.5.5 for inspection.
Results logged to /Users/user/.rvm/gems/ruby-1.9.3-p194/gems/nokogiri-1.5.5/ext/nokogiri/gem_make.out
An error occurred while installing nokogiri (1.5.5), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.5.5'` succeeds before bundling.
I have downloaded XCODE including the developer tools, so I do not know why it won't install nokogiri...
When I try to install nokogiri directly, I get:
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
/Users/ravinthambapillai/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
extconf.rb:86: warning: Insecure world writable dir /usr/local in PATH, mode 040777
checking for libxml/parser.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=/Users/ravinthambapillai/.rvm/rubies/ruby-1.9.3-p194/bin/ruby
--with-zlib-dir
--without-zlib-dir
--with-zlib-include
--without-zlib-include=${zlib-dir}/include
--with-zlib-lib
--without-zlib-lib=${zlib-dir}/lib
--with-iconv-dir
--without-iconv-dir
--with-iconv-include
--without-iconv-include=${iconv-dir}/include
--with-iconv-lib
--without-iconv-lib=${iconv-dir}/lib
--with-xml2-dir
--without-xml2-dir
--with-xml2-include
--without-xml2-include=${xml2-dir}/include
--with-xml2-lib
--without-xml2-lib=${xml2-dir}/lib
--with-xslt-dir
--without-xslt-dir
--with-xslt-include
--without-xslt-include=${xslt-dir}/include
--with-xslt-lib
--without-xslt-lib=${xslt-dir}/lib
--with-libxslt-config
--without-libxslt-config
--with-pkg-config
--without-pkg-config
--with-libxml-2.0-config
--without-libxml-2.0-config
--with-pkg-config
--without-pkg-config
--with-libiconv-config
--without-libiconv-config
--with-pkg-config
--without-pkg-config
/Users/ravinthambapillai/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /Users/ravinthambapillai/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:506:in `try_cpp'
from /Users/ravinthambapillai/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:970:in `block in find_header'
from /Users/ravinthambapillai/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for'
from /Users/ravinthambapillai/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone'
from /Users/ravinthambapillai/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /Users/ravinthambapillai/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone'
from /Users/ravinthambapillai/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /Users/ravinthambapillai/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:280:in `postpone'
from /Users/ravinthambapillai/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for'
from /Users/ravinthambapillai/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:969:in `find_header'
from extconf.rb:114:in `<main>'
Gem files will remain installed in /Users/ravinthambapillai/.rvm/gems/ruby-1.9.3-p194/gems/nokogiri-1.5.5 for inspection.
Results logged to /Users/ravinthambapillai/.rvm/gems/ruby-1.9.3-p194/gems/nokogiri-1.5.5/ext/nokogiri/gem_make.out
thanks,
After short research I find out what problem can be simply solved by creating symbolic link
sudo ln -s /usr/bin/gcc /usr/bin/gcc-4.2
works for me hope for you too
gem install nokogiri
Building native extensions. This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
/Users/morozovm/.rvm/rubies/ruby-1.9.3-p327/bin/ruby extconf.rb
checking for libxml/parser.h... *** extconf.rb failed ***
bash-3.2$ sudo ln -s /usr/bin/gcc /usr/bin/gcc-4.2
Password:
bash-3.2$ gem install nokogiri
Building native extensions. This could take a while...
Successfully installed nokogiri-1.5.6
1 gem installed
Try these. I faced the same issue and it worked for me. First install libxml2 and then run bundler again.
brew install libxml2
brew link libxml2
Source: http://decielo.com/articles/11/rails-3-on-lion-hey-ho-lets-go
Update:
I am hoping that you have homebrew installed. If you don't have homebrew then I will suggest you to install homebrew and then install libxml2 and then bundler. Don't use mac ports in case you don't have homebrew.
Update:
It's not an issue of command line tools. It's failing at libxml. Try to read the error and you will see
checking for libxml/parser.h... *** extconf.rb failed ***
And that's the issue
I think this is the most important bit of the error message:
warning: Insecure world writable dir /usr/local in PATH, mode 040777
Some part of the build process is whining that that directory has permissions such that anyone can write to it. You could try to hunt it down - or you could fix it.
Related
I ran into a new nokogiri problem and I tried every possible solution I could find online on Stack Overflow. My ruby version is 3.0.1, rbenv is 1.1.2 and rails is 6.4.1. When I run "bundle install" I get the following error and I have no clue how to fix it. The error in itself is very long so I posting the entire thing! Any help would be appreciated! Thanks!!
Fetching gem metadata from https://rubygems.org/............
Resolving dependencies....
Using rake 13.0.6
Using concurrent-ruby 1.1.9
Using minitest 5.14.4
.
.
.
Fetching nokogiri 1.12.3
Using activerecord 6.1.4.1
Using activejob 6.1.4.1
Using jbuilder 2.11.2
Using spring 2.1.1
Installing nokogiri 1.12.3 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /Users/zerad/coding
Projects/rubyProjects/environment/testapp/vendor/cache/ruby/3.0.0/gems/nokogiri-1.12.3/ext/nokogiri
/Users/zerad/.rbenv/versions/3.0.1/bin/ruby -I
/Users/zerad/.rbenv/versions/3.0.1/lib/ruby/site_ruby/3.0.0 -r
./siteconf20210827-1071-swdvid.rb extconf.rb --use-system-libraries
--with-xml2-include\=/usr/local/opt/libxml2/include/libxml2
checking for whether -std=c99 is accepted as CFLAGS... yes
checking for whether -Wno-declaration-after-statement is accepted as CFLAGS...
yes
checking for whether -g is accepted as CFLAGS... yes
checking for whether -Winline is accepted as CFLAGS... yes
checking for whether -Wmissing-noreturn is accepted as CFLAGS... yes
checking for whether
-Wno-error=unused-command-line-argument-hard-error-in-future is accepted as
CFLAGS... no
checking for whether
-I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/libxml2 is
accepted as CPPFLAGS... yes
Building nokogiri using system libraries.
checking for gzdopen() in -lz... yes
checking for xmlParseDoc() in -lxml2... yes
checking for xsltParseStylesheetDoc() in -lxslt... yes
checking for exsltFuncRegister() in -lexslt... yes
Using mini_portile version 2.6.1
---------- IMPORTANT NOTICE ----------
Building Nokogiri with a packaged version of libgumbo-1.0.0-nokogiri.
Configuration options: --enable-shared --disable-static
Copying gumbo-parser files into
tmp/x86_64-apple-darwin19/ports/libgumbo/1.0.0-nokogiri/gumbo-parser...
Running 'compile' for libgumbo 1.0.0-nokogiri... OK
Activating libgumbo 1.0.0-nokogiri (from
ports/x86_64-apple-darwin19/libgumbo/1.0.0-nokogiri)...
checking for whether -I/Users/zerad/coding
Projects/rubyProjects/environment/testapp/vendor/cache/ruby/3.0.0/gems/nokogiri-1.12.3/ext/nokogiri/ports/x86_64-apple-darwin19/libgumbo/1.0.0-nokogiri/include
is accepted as CPPFLAGS... no
checking for gumbo_parse_with_options() in gumbo.h... no
-----
extconf.rb:276:in `ensure_func'
gumbo_parse_with_options is missing. Please locate mkmf.log to investigate how
it is failing.
-----
*** 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=/Users/zerad/.rbenv/versions/3.0.1/bin/$(RUBY_BASE_NAME)
--help
--clean
--prevent-strip
--enable-system-libraries
--disable-system-libraries
--use-system-libraries
--enable-system-libraries
--disable-system-libraries
--use-system-libraries
--with-zlib-dir
--without-zlib-dir
--with-zlib-include
--without-zlib-include=${zlib-dir}/include
--with-zlib-lib
--without-zlib-lib=${zlib-dir}/lib
--with-z-dir
--without-z-dir
--with-z-include
--without-z-include=${z-dir}/include
--with-z-lib
--without-z-lib=${z-dir}/lib
--with-zlib
--without-zlib
--with-xml2-dir
--without-xml2-dir
--with-xml2-include=${xml2-dir}/include
--with-xml2-lib
--without-xml2-lib=${xml2-dir}/lib
--with-xml2lib
--without-xml2lib
--with-xslt-dir
--without-xslt-dir
--with-xslt-include
--without-xslt-include=${xslt-dir}/include
--with-xslt-lib
--without-xslt-lib=${xslt-dir}/lib
--with-xsltlib
--without-xsltlib
--with-exslt-dir
--without-exslt-dir
--with-exslt-include
--without-exslt-include=${exslt-dir}/include
--with-exslt-lib
--without-exslt-lib=${exslt-dir}/lib
--with-exsltlib
--without-exsltlib
--enable-cross-build
--disable-cross-build
To see why this extension failed to compile, please check the mkmf.log which can
be found here:
/Users/zerad/coding
Projects/rubyProjects/environment/testapp/vendor/cache/ruby/3.0.0/extensions/x86_64-darwin-19/3.0.0/nokogiri-1.12.3/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /Users/zerad/coding
Projects/rubyProjects/environment/testapp/vendor/cache/ruby/3.0.0/gems/nokogiri-1.12.3
for inspection.
Results logged to /Users/zerad/coding
Projects/rubyProjects/environment/testapp/vendor/cache/ruby/3.0.0/extensions/x86_64-darwin-19/3.0.0/nokogiri-1.12.3/gem_make.out
/Users/zerad/.rbenv/versions/3.0.1/lib/ruby/site_ruby/3.0.0/rubygems/ext/builder.rb:92:in
`run'
/Users/zerad/.rbenv/versions/3.0.1/lib/ruby/site_ruby/3.0.0/rubygems/ext/ext_conf_builder.rb:47:in
`block in build'
/Users/zerad/.rbenv/versions/3.0.1/lib/ruby/3.0.0/tempfile.rb:317:in
`open'
/Users/zerad/.rbenv/versions/3.0.1/lib/ruby/site_ruby/3.0.0/rubygems/ext/ext_conf_builder.rb:26:in
`build'
/Users/zerad/.rbenv/versions/3.0.1/lib/ruby/site_ruby/3.0.0/rubygems/ext/builder.rb:158:in
`build_extension'
/Users/zerad/.rbenv/versions/3.0.1/lib/ruby/site_ruby/3.0.0/rubygems/ext/builder.rb:192:in
`block in build_extensions'
/Users/zerad/.rbenv/versions/3.0.1/lib/ruby/site_ruby/3.0.0/rubygems/ext/builder.rb:189:in
`each'
/Users/zerad/.rbenv/versions/3.0.1/lib/ruby/site_ruby/3.0.0/rubygems/ext/builder.rb:189:in
`build_extensions'
/Users/zerad/.rbenv/versions/3.0.1/lib/ruby/site_ruby/3.0.0/rubygems/installer.rb:837:in
`build_extensions'
/Users/zerad/.rbenv/versions/3.0.1/lib/ruby/site_ruby/3.0.0/bundler/rubygems_gem_installer.rb:66:in
`build_extensions'
/Users/zerad/.rbenv/versions/3.0.1/lib/ruby/site_ruby/3.0.0/bundler/rubygems_gem_installer.rb:26:in
`install'
/Users/zerad/.rbenv/versions/3.0.1/lib/ruby/site_ruby/3.0.0/bundler/source/rubygems.rb:192:in
`install'
/Users/zerad/.rbenv/versions/3.0.1/lib/ruby/site_ruby/3.0.0/bundler/installer/gem_installer.rb:54:in
`install'
/Users/zerad/.rbenv/versions/3.0.1/lib/ruby/site_ruby/3.0.0/bundler/installer/gem_installer.rb:59:in
`block in install_with_settings'
/Users/zerad/.rbenv/versions/3.0.1/lib/ruby/site_ruby/3.0.0/bundler/rubygems_integration.rb:556:in
`install_with_build_args'
/Users/zerad/.rbenv/versions/3.0.1/lib/ruby/site_ruby/3.0.0/bundler/installer/gem_installer.rb:59:in
`install_with_settings'
/Users/zerad/.rbenv/versions/3.0.1/lib/ruby/site_ruby/3.0.0/bundler/installer/gem_installer.rb:16:in
`install_from_spec'
/Users/zerad/.rbenv/versions/3.0.1/lib/ruby/site_ruby/3.0.0/bundler/installer/parallel_installer.rb:186:in
`do_install'
/Users/zerad/.rbenv/versions/3.0.1/lib/ruby/site_ruby/3.0.0/bundler/installer/parallel_installer.rb:177:in
`block in worker_pool'
/Users/zerad/.rbenv/versions/3.0.1/lib/ruby/site_ruby/3.0.0/bundler/worker.rb:62:in
`apply_func'
/Users/zerad/.rbenv/versions/3.0.1/lib/ruby/site_ruby/3.0.0/bundler/worker.rb:57:in
`block in process_queue'
/Users/zerad/.rbenv/versions/3.0.1/lib/ruby/site_ruby/3.0.0/bundler/worker.rb:54:in
`loop'
/Users/zerad/.rbenv/versions/3.0.1/lib/ruby/site_ruby/3.0.0/bundler/worker.rb:54:in
`process_queue'
/Users/zerad/.rbenv/versions/3.0.1/lib/ruby/site_ruby/3.0.0/bundler/worker.rb:91:in
`block (2 levels) in create_threads'
An error occurred while installing nokogiri (1.12.3), and Bundler
cannot continue.
In Gemfile:
rails was resolved to 6.1.4.1, which depends on
actioncable was resolved to 6.1.4.1, which depends on
actionpack was resolved to 6.1.4.1, which depends on
actionview was resolved to 6.1.4.1, which depends on
rails-dom-testing was resolved to 2.0.3, which depends on
nokogiri
I had the same error with version 1.12.3. Upgrading to version 1.12.4 fixed it.
Try reinstalling everything.
I ended up here after using Ruby on Rails after a few months. Deleted Ruby and cleaned everything up, reinstalled both ruby and rails using rbenv, and updated yarn. Followed the tutorial on goRails and made sure there were no anomalies.
For example, if you installed ruby 3.0.1 but "ruby -v" gives you 2.7.2, there's a problem. If you installed rails 6.1.3 but it shows 6.1.4, that's another problem.
Migrating my rails app from 3.2 to 4.0.0 and ruby 2.2.2 to 2.2.4
while doing bundle install am getting (An error occurred while installing debug_inspector (0.0.2), and Bundler cannot continue) issue.
using ubuntu 14.04LTS.
This is what happens when i type in the bundle command
Installing debug_inspector 0.0.2 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/usr/share/rvm/rubies/ruby-2.2.4/bin/ruby -r ./siteconf20160727-7643-zx17cc.rb extconf.rb
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling debug_inspector.c
linking shared-object debug_inspector.so
/usr/bin/ld: cannot find -lgmp
collect2: error: ld returned 1 exit status
make: *** [debug_inspector.so] Error 1
make failed, exit code 2
Gem files will remain installed in /home/vpidev/.rvm/gems/ruby-2.2.4#ping/gems/debug_inspector-0.0.2 for inspection.
Results logged to /home/vpidev/.rvm/gems/ruby-2.2.4#ping/extensions/x86_64-linux/2.2.0/debug_inspector-0.0.2/gem_make.out
Using sass 3.4.22
Using will_paginate 3.0.7
Using uniform_notifier 1.10.0
Installing byebug 9.0.5 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/usr/share/rvm/rubies/ruby-2.2.4/bin/ruby -r ./siteconf20160727-7643-1w1gc0x.rb extconf.rb
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling context.c
compiling locker.c
compiling threads.c
compiling breakpoint.c
compiling byebug.c
linking shared-object byebug/byebug.so
/usr/bin/ld: cannot find -lgmp
collect2: error: ld returned 1 exit status
make: *** [byebug.so] Error 1
make failed, exit code 2
Gem files will remain installed in /home/vpidev/.rvm/gems/ruby-2.2.4#ping/gems/byebug-9.0.5 for inspection.
Results logged to /home/vpidev/.rvm/gems/ruby-2.2.4#ping/extensions/x86_64-linux/2.2.0/byebug-9.0.5/gem_make.out
Using highline 1.7.8
Using net-ssh 3.2.0
Using mini_portile 0.6.2
Installing json 1.8.3 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/usr/share/rvm/rubies/ruby-2.2.4/bin/ruby -r ./siteconf20160727-7643-6baclf.rb extconf.rb
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling generator.c
linking shared-object json/ext/generator.so
/usr/bin/ld: cannot find -lgmp
collect2: error: ld returned 1 exit status
make: *** [generator.so] Error 1
make failed, exit code 2
Gem files will remain installed in /home/vpidev/.rvm/gems/ruby-2.2.4#ping/gems/json-1.8.3 for inspection.
Results logged to /home/vpidev/.rvm/gems/ruby-2.2.4#ping/extensions/x86_64-linux/2.2.0/json-1.8.3/gem_make.out
Installing ffi 1.9.14 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/usr/share/rvm/rubies/ruby-2.2.4/bin/ruby -r ./siteconf20160727-7643-e5hbz0.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=/usr/share/rvm/rubies/ruby-2.2.4/bin/$(RUBY_BASE_NAME)
--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}/lib
--with-libffi-config
--without-libffi-config
--with-pkg-config
--without-pkg-config
/usr/share/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /usr/share/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:541:in `try_link0'
from /usr/share/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:556:in `try_link'
from /usr/share/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:637:in `try_ldflags'
from /usr/share/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:1780:in `pkg_config'
from extconf.rb:15:in `<main>'
extconf failed, exit code 1
Gem files will remain installed in /home/vpidev/.rvm/gems/ruby-2.2.4#ping/gems/ffi-1.9.14 for inspection.
Results logged to /home/vpidev/.rvm/gems/ruby-2.2.4#ping/extensions/x86_64-linux/2.2.0/ffi-1.9.14/gem_make.out
Using cliver 0.3.2
Using sexp_processor 4.7.0
Using coffee-script-source 1.10.0
Using execjs 2.7.0
Using country_select 1.2.0
Using daemons 1.0.10
Using database_cleaner 1.5.3
Using debugger-ruby_core_source 1.3.8
Using docile 1.1.5
Using dynamic_form 1.1.4
Using encryptor 1.3.0
Installing eventmachine 1.2.0.1 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/usr/share/rvm/rubies/ruby-2.2.4/bin/ruby -r ./siteconf20160727-7643-14d9qjy.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=/usr/share/rvm/rubies/ruby-2.2.4/bin/$(RUBY_BASE_NAME)
--with-ssl-dir
--without-ssl-dir
--with-ssl-include
--without-ssl-include=${ssl-dir}/include
--with-ssl-lib
--without-ssl-lib=${ssl-dir}/lib
--with-openssl-config
--without-openssl-config
--with-pkg-config
--without-pkg-config
/usr/share/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /usr/share/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:541:in `try_link0'
from /usr/share/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:556:in `try_link'
from /usr/share/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:637:in `try_ldflags'
from /usr/share/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:1780:in `pkg_config'
from extconf.rb:65:in `pkg_config_wrapper'
from extconf.rb:92:in `<main>'
extconf failed, exit code 1
Gem files will remain installed in /home/vpidev/.rvm/gems/ruby-2.2.4#ping/gems/eventmachine-1.2.0.1 for inspection.
Results logged to /home/vpidev/.rvm/gems/ruby-2.2.4#ping/extensions/x86_64-linux/2.2.0/eventmachine-1.2.0.1/gem_make.out
Using gem_plugin 0.2.3
Using tilt 2.0.5
Using hashie 3.4.4
Using headless 2.2.3
Using multi_xml 0.5.5
Installing libxml-ruby 2.7.0 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/usr/share/rvm/rubies/ruby-2.2.4/bin/ruby -r ./siteconf20160727-7643-ftfa2z.rb extconf.rb
checking for socket() in -lsocket... *** 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/share/rvm/rubies/ruby-2.2.4/bin/$(RUBY_BASE_NAME)
--with-iconv-dir
--without-iconv-dir
--with-iconv-include
--without-iconv-include=${iconv-dir}/include
--with-iconv-lib
--without-iconv-lib=${iconv-dir}/lib
--with-zlib-dir
--without-zlib-dir
--with-zlib-include
--without-zlib-include=${zlib-dir}/include
--with-zlib-lib
--without-zlib-lib=${zlib-dir}/lib
--with-socketlib
--without-socketlib
/usr/share/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /usr/share/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:541:in `try_link0'
from /usr/share/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:556:in `try_link'
from /usr/share/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:735:in `try_func'
from /usr/share/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:966:in `block in have_library'
from /usr/share/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:911:in `block in checking_for'
from /usr/share/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:351:in `block (2 levels) in postpone'
from /usr/share/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:321:in `open'
from /usr/share/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:351:in `block in postpone'
from /usr/share/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:321:in `open'
from /usr/share/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:347:in `postpone'
from /usr/share/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:910:in `checking_for'
from /usr/share/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:961:in `have_library'
from extconf.rb:29:in `<main>'
extconf failed, exit code 1
Gem files will remain installed in /home/vpidev/.rvm/gems/ruby-2.2.4#ping/gems/libxml-ruby-2.7.0 for inspection.
Results logged to /home/vpidev/.rvm/gems/ruby-2.2.4#ping/extensions/x86_64-linux/2.2.0/libxml-ruby-2.7.0/gem_make.out
Using light-daemon 0.9.7
Using systemu 2.4.2
Using memcache-client 1.8.5
Using metaclass 0.0.4
Using method_source 0.8.2
Using mustache 1.0.3
Installing mysql2 0.3.21 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/usr/share/rvm/rubies/ruby-2.2.4/bin/ruby -r ./siteconf20160727-7643-1dru9tp.rb extconf.rb
checking for ruby/thread.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/share/rvm/rubies/ruby-2.2.4/bin/$(RUBY_BASE_NAME)
/usr/share/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /usr/share/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:587:in `try_cpp'
from /usr/share/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:1060:in `block in have_header'
from /usr/share/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:911:in `block in checking_for'
from /usr/share/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:351:in `block (2 levels) in postpone'
from /usr/share/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:321:in `open'
from /usr/share/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:351:in `block in postpone'
from /usr/share/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:321:in `open'
from /usr/share/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:347:in `postpone'
from /usr/share/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:910:in `checking_for'
from /usr/share/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:1059:in `have_header'
from extconf.rb:15:in `<main>'
extconf failed, exit code 1
Gem files will remain installed in /home/vpidev/.rvm/gems/ruby-2.2.4#ping/gems/mysql2-0.3.21 for inspection.
Results logged to /home/vpidev/.rvm/gems/ruby-2.2.4#ping/extensions/x86_64-linux/2.2.0/mysql2-0.3.21/gem_make.out
Using newrelic_rpm 3.9.9.275
Using nori 1.0.2
Installing oj 2.17.1 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/usr/share/rvm/rubies/ruby-2.2.4/bin/ruby -r ./siteconf20160727-7643-xze21i.rb extconf.rb
>>>>> Creating Makefile for ruby version 2.2.4 on x86_64-linux <<<<<
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling err.c
compiling strict.c
compiling parse.c
compiling cache8.c
compiling scp.c
compiling fast.c
compiling odd.c
compiling reader.c
compiling compat.c
compiling sparse.c
compiling object.c
compiling hash.c
compiling resolve.c
compiling saj.c
compiling oj.c
compiling hash_test.c
compiling dump.c
compiling circarray.c
compiling val_stack.c
linking shared-object oj/oj.so
/usr/bin/ld: cannot find -lgmp
collect2: error: ld returned 1 exit status
make: *** [oj.so] Error 1
make failed, exit code 2
Gem files will remain installed in /home/vpidev/.rvm/gems/ruby-2.2.4#ping/gems/oj-2.17.1 for inspection.
Results logged to /home/vpidev/.rvm/gems/ruby-2.2.4#ping/extensions/x86_64-linux/2.2.0/oj-2.17.1/gem_make.out
Using parallel 1.9.0
Using websocket-extensions 0.1.2
Using power_assert 0.3.0
Using slop 3.6.0
Using rails-simple-search 0.9.9
Using require_all 1.3.3
Using ruby-progressbar 1.8.1
Using rbx-require-relative 0.0.9
Installing rjb 1.5.3 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/usr/share/rvm/rubies/ruby-2.2.4/bin/ruby -r ./siteconf20160727-7643-r362l.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=/usr/share/rvm/rubies/ruby-2.2.4/bin/$(RUBY_BASE_NAME)
extconf.rb:53:in `<main>': JAVA_HOME is not set. (RuntimeError)
extconf failed, exit code 1
Gem files will remain installed in /home/vpidev/.rvm/gems/ruby-2.2.4#ping/gems/rjb-1.5.3 for inspection.
Results logged to /home/vpidev/.rvm/gems/ruby-2.2.4#ping/extensions/x86_64-linux/2.2.0/rjb-1.5.3/gem_make.out
Using rubyzip 1.2.0
Using rubygems-update 1.4.2
Using websocket 1.2.3
Using simplecov-html 0.10.0
Using temple 0.7.7
Using tabs_on_rails 1.3.3
Using minitest-test 1.1.0
Using activesupport 4.0.13
Using gyoku 1.0.0
Using rack-test 0.6.3
Using httpi 0.9.5
Using rack-utf8_sanitizer 1.3.2
Using mime-types 3.1
Using sprockets 3.6.3
Using concurrent-ruby-ext 1.0.2
Using fastimage 1.7.0
Using turn 0.9.7
Using better_errors 2.1.1
An error occurred while installing debug_inspector (0.0.2), and Bundler cannot continue.
Make sure that `gem install debug_inspector -v '0.0.2'` succeeds before bundling.
You're missing build dependencies. Do the following:
$ sudo apt-get update
$ sudo apt-get install build-essential
Then run bundler again.
/usr/bin/ld: cannot find -lgmp means that it can't find the gmp library. Try running:
sudo apt-get install libgmp3-dev
Then bundle.
/usr/bin/ld: cannot find -lgmp
You're missing the linux library gmp-devel
Also, https://github.com/CocoaPods/CocoaPods/issues/1727 indicates that the later issues might be down to bundler not being able to locate a version of gcc on your linux box.
I’m starting a Middleman app from scratch. Whenever I attempt to run the server, i.e. middleman server I get an error (below) that tells me “error occurred while installing nokogiri (1.6.6.2), and Bundler cannot continue.”
However, when I attempt to install nokogiri (1.6.6.2), I get another error (below) that says me “ERROR: Error installing nokogiri: ERROR: Failed to build gem native extension.”
I then attempt to bundle install my gemfile but receive another error. Can anyone tell me what I might be overlooking?
Whenever I attempt to run my middleman server command, I get this:
/Library/Ruby/Site/2.0.0/rubygems/dependency.rb:315:in `to_specs': Could not find 'nokogiri' (>= 1.3.3) among 67 total gem(s) (Gem::LoadError)
Checked in 'GEM_PATH=/Users/Wilhelm/.gem/ruby/2.0.0:/Library/Ruby/Gems/2.0.0:/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/gems/2.0.0', execute `gem env` for more information
from /Library/Ruby/Site/2.0.0/rubygems/specification.rb:1311:in `block in activate_dependencies'
from /Library/Ruby/Site/2.0.0/rubygems/specification.rb:1300:in `each'
from /Library/Ruby/Site/2.0.0/rubygems/specification.rb:1300:in `activate_dependencies'
from /Library/Ruby/Site/2.0.0/rubygems/specification.rb:1282:in `activate'
from /Library/Ruby/Site/2.0.0/rubygems/specification.rb:1314:in `block in activate_dependencies'
from /Library/Ruby/Site/2.0.0/rubygems/specification.rb:1300:in `each'
from /Library/Ruby/Site/2.0.0/rubygems/specification.rb:1300:in `activate_dependencies'
from /Library/Ruby/Site/2.0.0/rubygems/specification.rb:1282:in `activate'
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_gem.rb:67:in `block in gem'
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_gem.rb:66:in `synchronize'
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_gem.rb:66:in `gem'
from /usr/bin/middleman:22:in `<main>'
Here are the contents of my Gemfile:
# If you do not have OpenSSL installed, update
# the following line to use "http://" instead
source 'https://rubygems.org'
gem "middleman", "~>3.4.0"
# Live-reloading plugin
gem "middleman-livereload", "~> 3.1.0"
# For faster file watcher updates on Windows:
gem "wdm", "~> 0.1.0", :platforms => [:mswin, :mingw]
# Windows does not come with time zone data
gem "tzinfo-data", platforms: [:mswin, :mingw, :jruby]
and here are the results from my bundle install:
Fetching gem metadata from https://rubygems.org/.............
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies...
Using i18n 0.7.0
Using json 1.8.3
Using minitest 5.8.0
Using thread_safe 0.3.5
Using tzinfo 1.2.2
Using activesupport 4.2.4
Using bundler 1.8.2
Using mime-types 2.6.1
Using mini_portile 0.6.2
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -r ./siteconf20150828-20513-wkpoce.rb extconf.rb --use-system-libraries
checking if the C compiler accepts ... yes
checking if the C compiler accepts -Wno-error=unused-command-line-argument-hard-error-in-future... no
Building nokogiri using system libraries.
libxml2 version 2.6.21 or later is required!
*** 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=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
--help
--clean
--use-system-libraries
--with-zlib-dir
--without-zlib-dir
--with-zlib-include
--without-zlib-include=${zlib-dir}/include
--with-zlib-lib
--without-zlib-lib=${zlib-dir}/lib
--with-xml2-dir
--without-xml2-dir
--with-xml2-include
--without-xml2-include=${xml2-dir}/include
--with-xml2-lib
--without-xml2-lib=${xml2-dir}/lib
--with-libxml-2.0-config
--without-libxml-2.0-config
--with-pkg-config
--without-pkg-config
--with-xslt-dir
--without-xslt-dir
--with-xslt-include
--without-xslt-include=${xslt-dir}/include
--with-xslt-lib
--without-xslt-lib=${xslt-dir}/lib
--with-libxslt-config
--without-libxslt-config
--with-exslt-dir
--without-exslt-dir
--with-exslt-include
--without-exslt-include=${exslt-dir}/include
--with-exslt-lib
--without-exslt-lib=${exslt-dir}/lib
--with-libexslt-config
--without-libexslt-config
extconf failed, exit code 1
Gem files will remain installed in /var/folders/zn/zh_8qnr573x4wgbjz6gqz72w0000gn/T/bundler20150828-20513-11hlulx/nokogiri-1.6.6.2/gems/nokogiri-1.6.6.2 for inspection.
Results logged to /var/folders/zn/zh_8qnr573x4wgbjz6gqz72w0000gn/T/bundler20150828-20513-11hlulx/nokogiri-1.6.6.2/extensions/universal-darwin-14/2.0.0/nokogiri-1.6.6.2/gem_make.out
An error occurred while installing nokogiri (1.6.6.2), and Bundler cannot
continue.
Make sure that `gem install nokogiri -v '1.6.6.2'` succeeds before bundling.
and here are the results from my sudo gem install nokogiri -v '1.6.6.2':
Building native extensions. This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
/Users/Wilhelm/.rbenv/versions/1.9.3-dev/bin/ruby extconf.rb
checking if the C compiler accepts ... yes
checking if the C compiler accepts -Wno-error=unused-command-line-argument-hard-error-in-future... no
Building nokogiri using packaged libraries.
-----
The file "/usr/include/iconv.h" is missing in your build environment,
which means you haven't installed Xcode Command Line Tools properly.
To install Command Line Tools, try running `xcode-select --install` on
terminal and follow the instructions. If it fails, open Xcode.app,
select from the menu "Xcode" - "Open Developer Tool" - "More Developer
Tools" to open the developer site, download the installer for your OS
version and run it.
-----
*** 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=/Users/Wilhelm/.rbenv/versions/1.9.3-dev/bin/ruby
--help
--clean
--use-system-libraries
--enable-static
--disable-static
--with-zlib-dir
--without-zlib-dir
--with-zlib-include
--without-zlib-include=${zlib-dir}/include
--with-zlib-lib
--without-zlib-lib=${zlib-dir}/lib
--enable-cross-build
--disable-cross-build
Gem files will remain installed in /Users/Wilhelm/.rbenv/versions/1.9.3-dev/lib/ruby/gems/1.9.1/gems/nokogiri-1.6.6.2 for inspection.
Results logged to /Users/Wilhelm/.rbenv/versions/1.9.3-dev/lib/ruby/gems/1.9.1/gems/nokogiri-1.6.6.2/ext/nokogiri/gem_make.out
I have encountered this on a couple of system configs. It always ends up being a dev library dependency. If it were me, one at a time, I'd install these and try to bundle install:
libxslt-dev
libxml2-dev
ruby-dev
Depending on your system (I think on centos they are -devel not -dev).
This command:
sudo gem install nokogiri -- --with-xml2-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/libxml2 --use-system-libraries
found in this github issue, solved my problem. Honestly, I'm not entirely sure why so if anyone could append a comment, elucidating what exactly is going on it would be much appreciated.
I am trying to install Nokogiri using:
sudo gem install nokogiri
This is the mess that follows the installation:
Building native extensions. This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
/Users/micahsherman/.rvm/rubies/ruby-1.9.3-p429/bin/ruby extconf.rb
Extracting libxml2-2.8.0.tar.gz into tmp/x86_64-apple-darwin13.0.0/ports/libxml2/2.8.0... OK
Running 'configure' for libxml2 2.8.0... OK
Running 'compile' for libxml2 2.8.0... OK
Running 'install' for libxml2 2.8.0... OK
Activating libxml2 2.8.0 (from /Users/micahsherman/.rvm/gems/ruby-1.9.3-p429/gems/nokogiri-1.6.0/ports/x86_64-apple-darwin13.0.0/libxml2/2.8.0)...
Extracting libxslt-1.1.26.tar.gz into tmp/x86_64-apple-darwin13.0.0/ports/libxslt/1.1.26... OK
Running 'configure' for libxslt 1.1.26... OK
Running 'compile' for libxslt 1.1.26... OK
Running 'install' for libxslt 1.1.26... OK
Activating libxslt 1.1.26 (from /Users/micahsherman/.rvm/gems/ruby-1.9.3-p429/gems/nokogiri-1.6.0/ports/x86_64-apple-darwin13.0.0/libxslt/1.1.26)...
checking for libxml/parser.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
--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=/Users/micahsherman/.rvm/rubies/ruby-1.9.3-p429/bin/ruby
--with-zlib-dir
--without-zlib-dir
--with-zlib-include
--without-zlib-include=${zlib-dir}/include
--with-zlib-lib
--without-zlib-lib=${zlib-dir}/lib
--with-iconv-dir
--without-iconv-dir
--with-iconv-include
--without-iconv-include=${iconv-dir}/include
--with-iconv-lib
--without-iconv-lib=${iconv-dir}/lib
--with-xml2-dir
--without-xml2-dir
--with-xml2-include
--without-xml2-include=${xml2-dir}/include
--with-xml2-lib
--without-xml2-lib=${xml2-dir}/lib
--with-xslt-dir
--without-xslt-dir
--with-xslt-include
--without-xslt-include=${xslt-dir}/include
--with-xslt-lib
--without-xslt-lib=${xslt-dir}/lib
--with-libxslt-config
--without-libxslt-config
--with-pkg-config
--without-pkg-config
--with-libxml-2.0-config
--without-libxml-2.0-config
--with-libiconv-config
--without-libiconv-config
/Users/micahsherman/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /Users/micahsherman/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/mkmf.rb:506:in `try_cpp'
from /Users/micahsherman/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/mkmf.rb:970:in `block in find_header'
from /Users/micahsherman/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for'
from /Users/micahsherman/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone'
from /Users/micahsherman/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /Users/micahsherman/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone'
from /Users/micahsherman/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /Users/micahsherman/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/mkmf.rb:280:in `postpone'
from /Users/micahsherman/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for'
from /Users/micahsherman/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/mkmf.rb:969:in `find_header'
from extconf.rb:166:in `<main>'
Gem files will remain installed in /Users/micahsherman/.rvm/gems/ruby-1.9.3-p429/gems/nokogiri-1.6.0 for inspection.
Results logged to /Users/micahsherman/.rvm/gems/ruby-1.9.3-p429/gems/nokogiri-1.6.0/ext/nokogiri/gem_make.out
I would appreciate some tips or advice. I am using Ruby 1.9.4, Rails 3.2.13 and I cannot figure out why this isn't working. I am using Mavericks and I thought that might be the problem.
I have updated xcode, etc.
This is not a direct solution but setting you up in the right direction. rvm is pretty solid at resolving its own issues. Follow these steps and help rvm do its magic
run rvm requirements to find what is missing.
use rvm pkg (on old version of rvm) or rvm autolibs to install missing packages.
Make sure you read all the documentation rvm asks you to read in this process.
Once done successfully, try installing nokogiri.
I was trying to install nokogiri because it is required for rails to be started
$ rails s
/usr/local/rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.5/lib/bundler/spec_set.rb:90:in `block in materialize': Could not find nokogiri-1.5.5 in any of the sources (Bundler::GemNotFound)
from /usr/local/rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.5/lib/bundler/spec_set.rb:83:in `map!'
from /usr/local/rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.5/lib/bundler/spec_set.rb:83:in `materialize'
from /usr/local/rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.5/lib/bundler/definition.rb:127:in `specs'
from /usr/local/rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.5/lib/bundler/environment.rb:27:in `specs'
from /usr/local/rvm/gems/ruby-1.9.3-p194#global/gems/rubygems-bundler-1.0.3/lib/rubygems-bundler/noexec.rb:41:in `candidate?'
from /usr/local/rvm/gems/ruby-1.9.3-p194#global/gems/rubygems-bundler-1.0.3/lib/rubygems-bundler/noexec.rb:60:in `setup'
from /usr/local/rvm/gems/ruby-1.9.3-p194#global/gems/rubygems-bundler-1.0.3/lib/rubygems-bundler/noexec.rb:75:in `<top (required)>'
from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `require'
from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
from /usr/local/rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:9:in `<main>'
However, it failed when I tried to install nokogiri with the command
$ sudo gem install nokogiri
Here is the error.
$ sudo gem install nokogiri
Building native extensions. This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
/usr/local/rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
checking for libxml/parser.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
--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/rvm/rubies/ruby-1.9.3-p194/bin/ruby
--with-zlib-dir
--without-zlib-dir
--with-zlib-include
--without-zlib-include=${zlib-dir}/include
--with-zlib-lib
--without-zlib-lib=${zlib-dir}/lib
--with-iconv-dir
--without-iconv-dir
--with-iconv-include
--without-iconv-include=${iconv-dir}/include
--with-iconv-lib
--without-iconv-lib=${iconv-dir}/lib
--with-xml2-dir
--without-xml2-dir
--with-xml2-include
--without-xml2-include=${xml2-dir}/include
--with-xml2-lib
--without-xml2-lib=${xml2-dir}/lib
--with-xslt-dir
--without-xslt-dir
--with-xslt-include
--without-xslt-include=${xslt-dir}/include
--with-xslt-lib
--without-xslt-lib=${xslt-dir}/lib
--with-libxslt-config
--without-libxslt-config
--with-pkg-config
--without-pkg-config
--with-libxml-2.0-config
--without-libxml-2.0-config
--with-libiconv-config
--without-libiconv-config
/usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:506:in `try_cpp'
from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:970:in `block in find_header'
from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for'
from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone'
from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone'
from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:280:in `postpone'
from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for'
from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:969:in `find_header'
from extconf.rb:114:in `<main>'
Gem files will remain installed in /usr/local/rvm/gems/ruby-1.9.3-p194/gems/nokogiri-1.5.5 for inspection.
Results logged to /usr/local/rvm/gems/ruby-1.9.3-p194/gems/nokogiri-1.5.5/ext/nokogiri/gem_make.out
It looks like you need to install Xcode.
The reason you're getting this error is because the nokogiri gem includes C/C++ extensions that need to be compiled on your machine before they can run.
Just installing XCode won't fix it--you need to specifically install the XCode Command Line Tools, which is a C/C++ compiler/linker toolchain that isn't installed by default when you install XCode.
There's an option to install them within a menu inside the XCode GUI, see this thread for a screenshot:
Xcode 4.4 and later install Command Line Tools
If you've already done that, then you may need to create a symbolic link to your compiler so your OS knows where to find it:
Installing nokogiri Mac OS X 10.8.2 XCode installed