Skip to content

Instantly share code, notes, and snippets.

@martinisoft
Last active October 1, 2015 23:48
Show Gist options
  • Save martinisoft/2127100 to your computer and use it in GitHub Desktop.
Save martinisoft/2127100 to your computer and use it in GitHub Desktop.
Nokogiri working install with latest XCode or you get "WARNING: Nokogiri was built against LibXML version 2.9.0, but has dynamically loaded 2.7.8"

Homebrew has blacklisted libiconv so the majority of your help via google will not work now.
Here's a way I figured out how to get nokogiri to compile if you made the mistake of upgrading your XCode version

  1. Install packages via homebrew
brew update
brew install libxml2
brew install libxslt
  1. Tell bundler how to build this by default Note that the version in the path there must match the installed version in your homebrew. If in doubt, run the command brew info libxml2 or brew info libxslt to find out which version you have installed.
bundle config build.nokogiri --with-xml2-include=$HOMEBREW_HOME/Cellar/libxml2/2.9.0/include/libxml2 --with-xml2-lib=$HOMEBREW_HOME/Cellar/libxml2/2.9.0/lib --with-xslt-dir=$HOMEBREW_HOME/Cellar/libxslt/1.1.28
  1. If you have nokogiri installed already, remove it
gem uninstall nokogiri
  1. Bundle again to install
bundle install
@dominicsayers
Copy link

😺

Copy link

ghost commented Apr 11, 2013

Mountain Lion 1.8.3
XCode 4.6.1
ruby 1.9.3p392
rails 3.2.13

Your above steps resolved my issue without any pain.

Thank you,

Bravebellows (aka Andy Markley)

@efatsi
Copy link

efatsi commented Apr 11, 2013

Perfect, thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment