Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libiconv is missing -nokogiri (1.6.3.1) #1140

Closed
ericbrooke opened this issue Jul 28, 2014 · 6 comments
Closed

libiconv is missing -nokogiri (1.6.3.1) #1140

ericbrooke opened this issue Jul 28, 2014 · 6 comments

Comments

@ericbrooke
Copy link

Mac OS X 10.9.4/ Ruby 2.1.2/ Homebrew 0.9

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

.rvm/rubies/ruby-2.1.2/bin/ruby extconf.rb
Building nokogiri using packaged libraries.
libiconv is missing. please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies.
extconf.rb failed

An error occurred while installing nokogiri (1.6.3.1), and Bundler cannot continue. Make sure that gem install nokogiri -v '1.6.3.1' succeeds before bundling.

$brew install libiconv
Warning: libiconv-1.14 already installed

$brew link libiconv
Warning: Already linked: /usr/local/Cellar/libiconv/1.14

Tried these solutions:
#442

@ericbrooke
Copy link
Author

Followed the instructions on Homebrew 0.9 http://nokogiri.org/tutorials/installing_nokogiri.html#homebrew_09
which work, just updated to later versions

The gem finally installs, BUT

It breaks my rails :-(

Reason: Incompatible library version: nokogiri.bundle requires version 8.0.0 or later, but libiconv.2.dylib provides version 7.0.0 - /.rvm/gems/ruby-2.1.2@mbh/extensions/x86_64-darwin-13/2.1.0-static/nokogiri-1.6.3.1/nokogiri/nokogiri.bundle

@knu
Copy link
Member

knu commented Jul 29, 2014

So, what's the real error found in mkmf.log?

@markjreed
Copy link

OK, the problem for me was that the system-installed Ruby is universal and tries to build universal native extensions, but the homebrew-installed libraries are x86_64 only. I was able to get it to work by manually mangling the system rbconfig.rb so that it only reports x86_64 instead of universal.

@paulhhowells
Copy link

ericbrooke wrote:

Followed the instructions on Homebrew 0.9 http://nokogiri.org/tutorials/installing_nokogiri.html#homebrew_09 
which work, just updated to later versions

however I noticed that

brew install libxml2 libxslt

installs libxml2 2.9.1

and so when attempting gem install nokogiri with all the options in the instructions, it fails with:

For example, libxml2-2.9.0 and higher are currently known to be broken
and thus unsupported by nokogiri, due to compatibility problems and
XPath optimization bugs.

@drale2k
Copy link

drale2k commented Aug 30, 2014

The instructions on the website don't work. It says the options i pass do not exist

invalid option: --with-iconv-include=/usr/local/Cellar/libiconv/1.14/include

Update: I forgot to pass 2 dashes before the option flags like "-- --with... "

@flavorjones
Copy link
Member

I believe the installation tutorial currently provides a working procedure for OSX:

http://www.nokogiri.org/tutorials/installing_nokogiri.html

Please take a look at that and let me know if it's missing anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants