Created
November 25, 2011 17:00
-
-
Save cbetta/1393974 to your computer and use it in GitHub Desktop.
How to fix a segfault for Nokogiri on Ruby 1.8.7 on OS X
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First install libxslt and libxml2 using Homebrew | |
brew install libxslt | |
brew install libxml2 | |
# Now rebuild nokogiri with these new libs (make sure to update version numbers if your homebrew installed a different version) | |
gem install nokogiri -- --with-xml2-include=/usr/local/Cellar/libxml2/2.7.8/include --with-xml2-lib=/usr/local/Cellar/libxml2/2.7.8/lib --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.26/ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What I suggested (
--with-xml2-dir
) doesn't work, as the include directory of libxml2 as installed by homebrew is nested, not justinclude/
. I also had to install libiconv and supply--with-libiconv-dir
for it to both compile and link against libxml2 2.7.8.