From: Bob Hutchison Date: 2010-09-12T22:10:22+09:00 Subject: Re: Nokogiri and LibXML (Important information) Hi, I'm going to reply to this message because I have a couple of comments, but there's also a bit of what turned out for me and the developers in my company rather important information... On 2010-09-08, at 3:10 AM, Une Bévue wrote: > elise huard wrote: > >> on Mac OS X you could use the homebrew package manager, it's easy to >> install and to use, I don't use macports anymore. > > Why did you stop using MacPorts ? > I have to look about that... I have been having a growing annoyance with MacPorts for a while, nothing specific, but definitely there. I switched to homebrew a couple of weeks ago on one of my machines then on another last Friday (that's Sept 10, the day after this thread, and I'm just reading this now). The best thing about homebrew is that it's i) fast; ii) *I* can understand exactly what's been done. It doesn't have a lot of packages that I used from MacPorts, but as Elise said, that's easy enough to deal with. > >> http://github.com/mxcl/homebrew >> libxml installed with homebrew: >> >> brew info libxml2 >> libxml2 2.7.7 >> http://xmlsoft.org >> /usr/local/Cellar/libxml2/2.7.7 (293 files, 12M) >> http://github.com/mxcl/homebrew/commits/master/Library/Formula/libxml2.rb This is the important part. The other machine I mentioned is one that I've been using to develop a pretty substantial web application. We have been having a peculiar problem with ruby-libxml for likely 18 months now. We've eliminated the library from our code base in favour of Nokogiri. The problem is a memory corruption error (we think caused by traversals of the the DOM) that occurs some time *after* the fact as a GC error. Over time, through a process of elimination over took a month or two, we are convinced that it was the ruby-libxml library causing the problem. On Friday I switched to homebrew, rvm, using Nokogiri. The memory corruption problem reappeared. After a lot of sweating and a little googling and I found this blog post: http://bennyfreshness.posterous.com/installing-nokogiri-with-homebrew-install-of Please read that if you are using OS X. If you do what he says, for me most importantly: gem install nokogiri -- --with-xml2-include=/usr/local/Cellar/libxml2/2.7.7/include/libxml2 --with-xml2-lib=/usr/local/Cellar/libxml2/2.7.7/lib the problem goes away. I am now suspicious that our problems with ruby-libxml were for the same or similar reasons. libxml2 comes with OS X, maybe there's some kind of confusion there? Don't know. Anyway, you should probably build Nokogiri this way. The problem is not apparent for some time after the actual damage was done. Short running tests do not illustrate the problem, at least, we've not found one. Cheers, Bob > > thanks a lot 4 your answer ! > -- > « Pour ceux qui vont chercher midi à quatorze heures, > la minute de vérité risque de se faire longtemps attendre. » > (Pierre Dac) > ---- Bob Hutchison Recursive Design Inc. http://www.recursive.ca/ weblog: http://xampl.com/so