I'm running Mac OSX "Yosemite", and I've been trying to install Nokogiri 1.6.1, but I keep running into the error below.
This is the error I ran into when I was trying to install Nokogiri 1.6.1:
sh-3.2# gem install nokogiri -v 1.6.1
Building native extensions. This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -r ./siteconf20150819-49747-fafnk9.rb extconf.rb
Extracting libxml2-2.8.0.tar.gz into tmp/x86_64-apple-darwin14.4.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 /Library/Ruby/Gems/2.0.0/gems/nokogiri-1.6.1/ports/x86_64-apple-darwin14.4.0/libxml2/2.8.0)...
Extracting libxslt-1.1.26.tar.gz into tmp/x86_64-apple-darwin14.4.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 /Library/Ruby/Gems/2.0.0/gems/nokogiri-1.6.1/ports/x86_64-apple-darwin14.4.0/libxslt/1.1.26)...
checking for libxml/parser.h... yes
checking for libxslt/xslt.h... yes
checking for libexslt/exslt.h... yes
checking for iconv_open() in iconv.h... no
checking for iconv_open() in -liconv... yes
checking for xmlParseDoc() in -lxml2... no
-----
libxml2 is missing. please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies.
-----
*** 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
--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
--with-iconvlib
--without-iconvlib
--with-xml2lib
--without-xml2lib
extconf failed, exit code 1
Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/nokogiri-1.6.1 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-14/2.0.0/nokogiri-1.6.1/gem_make.out
I tried everything on http://www.nokogiri.org/tutorials/installing_nokogiri.html, but I have been unsuccessful. I tried to install libxml2 to install Nokogiri 1.6.1, but my terminal says:
Cowardly refusing to `sudo brew install`
Sometimes installing Nokogiri is tricky as it has several dependencies, which is what happened in your case too.
"Installing Nokogiri" is a step-by-step tutorial on how to install Nokogiri on your Mac OSX system.
You need to install Package first
xcode-select --install
then
gem install nokogiri
Related
I am getting an error and bundle install fails:
An error occurred while installing nokogiri (1.9.1), and Bundler cannot continue. Make sure that gem install nokogiri -v '1.9.1' --source 'https://rubygems.org/' succeeds before bundling.
I have tried many commands from stack overflow but no luck yet.
After reading some posts about the issue I added the following environment variables but the bundle install still fails.
export PATH="/usr/local/opt/libxslt/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/libxslt/lib"
export CPPFLAGS="-I/usr/local/opt/libxslt/include"
sudo gem install nokogiri -v "1.9.1" -- --use-system-libraries
Building native extensions with: '--use-system-libraries'
This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
/Users/wiii/.rbenv/versions/2.1.5/bin/ruby 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.
checking for xmlParseDoc() in libxml/parser.h... yes
checking for xsltParseStylesheetDoc() in libxslt/xslt.h... no
checking for xsltParseStylesheetDoc() in -lxslt... no
checking for xsltParseStylesheetDoc() in -llibxslt... no
-----
libxslt 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/wiii/.rbenv/versions/2.1.5/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
--with-xsltlib
--without-xsltlib
--with-libxsltlib
--without-libxsltlib
extconf failed, exit code 1
Debugging info are attached below:
$ which ruby
/Users/wiii/.rbenv/shims/ruby
$ which bundle
/Users/wiii/.rbenv/shims/bundle
$ which gem
/Users/wiii/.rbenv/shims/gem
$ ruby --version
ruby 2.1.5p273 (2014-11-13 revision 48405) [x86_64-darwin19.0]
$ bundle --version
Bundler version 1.17.3
$ gem --version
2.2.2
Homebrew
% brew list
ansible kind libxslt openssl#1.0 ruby-build
autoconf kubectx libyaml openssl#1.1 sqlite
gdbm kubernetes-cli mpdecimal pkg-config tcl-tk
go libgcrypt mysql#5.7 protobuf tomcat#8
htop libgpg-error ncurses python#3.9 xz
icu4c libiconv node rbenv
k9s libxml2 openjdk readline
intellij-idea
Could anyone share some thoughts on what might be causing the issues here?
Nokogiri is an open source software library to parse HTML and XML in Ruby. It depends on libxml2 and libxslt to provide its functionality. without it Rails is non-functional.
it seems as if your macOS is missing some essential libraries required for nokogiri to run on your computer.
you can go ahead and first uninstall nokogiri and any other interfering library that you might have installed during your endeavor to solve this issue
run brew uninstall nokogiri
upon uninstalling, you can run brew install libxml2 libxslt to install the most essential libraries using brew
after that, run gem install nokogiri --platform=ruby -- --use-system-libraries to successfully install nokogiri
I tried to open the rails console, but found the error as below:
rails c
Could not find nokogiri-1.6.0 in any of the sources
Run `bundle install` to install missing gems.
then I run the bundle install
Installing nokogiri (1.6.0)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/liuxingqi/.rbenv/versions/1.9.3-p0/bin/ruby extconf.rb
Extracting libxml2-2.8.0.tar.gz into tmp/i686-apple-darwin11/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/liuxingqi/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/nokogiri-1.6.0/ports/i686-apple-darwin11/libxml2/2.8.0)...
Extracting libxslt-1.1.26.tar.gz into tmp/i686-apple-darwin11/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/liuxingqi/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/nokogiri-1.6.0/ports/i686-apple-darwin11/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
--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/liuxingqi/.rbenv/versions/1.9.3-p0/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/liuxingqi/.rbenv/versions/1.9.3-p0/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/liuxingqi/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:506:in `try_cpp'
from /Users/liuxingqi/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:970:in `block in find_header'
from /Users/liuxingqi/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for'
from /Users/liuxingqi/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone'
from /Users/liuxingqi/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /Users/liuxingqi/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone'
from /Users/liuxingqi/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /Users/liuxingqi/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:280:in `postpone'
from /Users/liuxingqi/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for'
from /Users/liuxingqi/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:969:in `find_header'
from extconf.rb:166:in `<main>'
Gem files will remain installed in /Users/liuxingqi/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/nokogiri-1.6.0 for inspection.
Results logged to /Users/liuxingqi/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/nokogiri-1.6.0/ext/nokogiri/gem_make.out
An error occurred while installing nokogiri (1.6.0), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.6.0'` succeeds before bundling.
my ruby version:
ruby -v
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin14.0.0]
OS:
OSX Yosemite 10.10.1
Hope anyone can help me! Thanks.
I delete the Gemfile.lock, then run bundle install. Everything is ok! :)
I had into this error and this is what worked for me:
bundle config build.nokogiri --use-system-libraries
bundle install
To do sudo apt-get install build-essential patch ruby-dev zlib1g-dev liblzma-dev
And Try install again
Run
$ sudo apt-get install build-essential patch ruby-dev zlib1g-dev liblzma-dev
Then
$ gem install nokogiri
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.
In an attempt to get mysql installed on my mac for a rails project I followed an online suggestion of installing homebrew and removing mac ports. This is where the problems began. The rails project won't build, I am getting this:
[rake --prereqs] rake aborted!
dlopen(/Users/Parker/.rvm/gems/ruby-1.9.3-p448/gems/nokogiri-1.6.0/lib/nokogiri/nokogiri.bundle, 9):
Library not loaded: /opt/local/lib/libiconv.2.dylib
Referenced from: /Users/Parker/.rvm/gems/ruby-1.9.3-p448/gems/nokogiri-1.6.0/lib/nokogiri/nokogiri.bundle
Reason: Incompatible library version: nokogiri.bundle requires version 8.0.0 or later, but libiconv.2.dylib provides version 7.0.0
/Users/Parker/.rvm/gems/ruby-1.9.3-p448/gems/nokogiri-1.6.0/lib/nokogiri/nokogiri.bundle
/Users/Parker/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:251:in `require'
...
I've tried the suggest of running
brew install libiconv
to which I receive the message:
Error: No available formula for libiconv
Apple distributes libiconv with OS X, you can find it in /usr/lib.
Some build scripts fail to detect it correctly, please check existing
formulae for solutions.
I've also tried
gem install nokogiri -- --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.28 --with-xml2-dir=/usr/local/Cellar/libxml2/2.9.1
to which I receive:
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
/Users/Parker/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.28 --with-xml2-dir=/usr/local/Cellar/libxml2/2.9.1
Extracting libxml2-2.8.0.tar.gz into tmp/x86_64-apple-darwin12.5.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/Parker/.rvm/gems/ruby-2.0.0-p247/gems/nokogiri-1.6.0/ports/x86_64-apple-darwin12.5.0/libxml2/2.8.0)...
Extracting libxslt-1.1.26.tar.gz into tmp/x86_64-apple-darwin12.5.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/Parker/.rvm/gems/ruby-2.0.0-p247/gems/nokogiri-1.6.0/ports/x86_64-apple-darwin12.5.0/libxslt/1.1.26)...
checking for libxml/parser.h... no
>
-----
libxml2 is missing. please visit http://nokogiri.org/tutorials/installing_nokogiri.html for
help with installing dependencies.
-----
*** 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/Parker/.rvm/rubies/ruby-2.0.0-p247/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
--with-xml2-include
--without-xml2-include=${xml2-dir}/include
--with-xml2-lib
--without-xml2-lib=${xml2-dir}/lib
--with-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
Gem files will remain installed in /Users/Parker/.rvm/gems/ruby-2.0.0-p247/gems/nokogiri-1.6.0 for inspection.
Results logged to /Users/Parker/.rvm/gems/ruby-2.0.0-p247/gems/nokogiri-1.6.0/ext/nokogiri/gem_make.out
I have worked to resolve this issue for well over 8 hours. I have tried every link and every suggest google supplies me with. I am completely stumped. It seems to me I'm in over my head and have caused some environment issues. I realize more information is probably needed, but I don't know what to supply. Please let me know what other information would help diagnose the problem.
I finally found a combination of suggestions that resolved my issue:
http://www.rqna.net/qna/swryr-bundle-install-stopped-at-nokogiri.html
brew tap homebrew/dupes
then:
brew install libiconv
brew link --force libiconv
Apparently 'brew tap homebrew/dupes' allowed me to use the 'brew install libiconv' without an error, and from there the 'brew link --force libiconv' remedied the issue.
When I try to run a ruby on rails project I got an error:
An error occurred while installing nokogiri (1.5.2), and bundle cannot continue.
Make sure that 'gem install nokogiri -v 1.5.2 succeed before building.
I'm working on Ubuntu 10.10
My co-worker uses on Windows/RVM and does not have this problem.
Edit:
gem_make.out
/opt/bitnami/ruby/bin/ruby extconf.rb
extconf.rb:10: Use RbConfig instead of obsolete and deprecated Config.
checking for libxml/parser.h... yes
checking for libxslt/xslt.h... yes
checking for libexslt/exslt.h... yes
checking for iconv_open() in iconv.h... no
checking for iconv_open() in -liconv... no
-----
libiconv is missing. please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies.
-----
*** 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=/opt/bitnami/ruby/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-iconvlib
--without-iconvlib
From the output:
libiconv is missing. please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies.
Install libiconv.
nokogiri requirements
sudo apt-get install libxslt-dev libxml2-dev
sudo gem install nokogiri
You can visit http://nokogiri.org/tutorials/installing_nokogiri.html
It should not be necessary to install any additonal package. You can use the libraries includes with BitNami (in /opt/bitnami/common). You just need to load the BitNami environment and specify the path to libxml2 files. While testing this I got similar issue but with libxml2, a similar solution can be applied for the iconv error that you are receiving.
$/opt/bitnami/rubyconsole
$sudo gem install nokogiri -- --with-xml2-dir=/opt/bitnami/common --with-xml2-include=/opt/bitnami/common/include/libxml2
Building native extensions. This could take a while...
Successfully installed nokogiri-1.5.2
1 gem installed
Installing ri documentation for nokogiri-1.5.2...
Installing RDoc documentation for nokogiri-1.5.2...
The solution of installing the system packages and used them should also work.
what works for me (Mac OS X):
$ xcode-select --install