Written on December 31, 2011
As usual i always started with the case i’ve caught on, today i’m trying to use pismo and distillery to extract attributes of html documents or urls. I got things going good on a few attributes but not on another important attributes, whenever i called the another attributes method to fetch it, it always returning segmentation fault error with not so short backtrace information.
I was using osx lion with the ruby 1.9.2-p290 installed, for detailed information here is the ruby -v printed out:
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.2.0]
The solution was upgrading native extensions that is being used by nokogiri, they are libxml2 and libxslt. Since i’m using brew i uninstall those two packages and reinstall it:
brew uninstall libxml2 libxslt
brew install libxml2 libxslt
And then reinstall the nokogiri with the brand new installed xml2 and xslt:
gem uninstall nokogiri
gem install nokogiri — –with-xml2-include=/usr/local/Cellar/libxml2/2.7.8/include/libxml2 –with-xml2-lib=/usr/local/Cellar/libxml2/2.7.8/lib –with-xslt-dir=/usr/local/Cellar/libxslt/1.1.26
After they are done, there should no segfault appeared on your screen anymore.
Tags: libxml2, libxslt, nokogiri, nokogiri segfault