libxml-ruby vs nokogiri vs hpricot

Update: Aaron told me that he is going to be re-running the benchmarks this weekend so we’ll get a more complete set of data from the machine that originally ran the tests.

If you’re into parsing XML or HTML with ruby then chances are you’re familiar with the various gems out there for getting the job done.  Lately, there have been a lot of things flying around about which is the fastest and to settle it, Aaron Patterson (author of Nokogiri and Mechanize) wrote a test suite.

After it’s release, RubyInside posted about how the tests showed how fast Nokogiri was compared to Hpricot in this article here: Ruby XML Performance Shootout: Nokogiri vs LibXML vs Hpricot vs REXML.  Later in the day, I saw Why’s posting about the release of Hpricot here: hpricot 0.7 and decided to modify Aaron’s tests to use Hpricot.XML and here are the results:
Read More…

Posted in Comedy, New Stuff, Software Development, ruby at March 18th, 2009. 2 Comments.

you need to write me [updated]

About 20 minutes ago I entered a situation where every time I ran a script on my machine, the only output would be “you need to write me”

Naturally I was a little freaked out.

After retracing my steps over the past hour I remembered I had updated my ruby gems with a good ol “sudo gem update.”  I do it all the time so I didn’t see the cause for concern.  I went and looked at the newly installed gems and saw that there was libxml-ruby-1.0.0.  I browsed inside the gem and saw that it had a bin directory that had a ruby executable in it.  Cute.  Whoever the person is who released that needs to pay super close attention to what they are doing in the future.

Anyhow, I uninstalled the gem and when it asked if I wanted to remove the ruby executable I said yes.  This of course trashed the ruby executable in my /usr/bin.  Luckily I was able to retrieve it from Jay Amster and all was well.  If I was to do things over I’d say not to trash the executable and just delete the gem and all of its files.

Having that broken ruby executable in my path devastated my system though.  Half of my Textmate scripts no longer worked, none of my rails apps would execute, etc.  It was awful.  Thankfully I was able to figure it out quickly and hopefully if you run a search for “you need to write me” then you’ll stumble upon this post and know what to do to fix your machine.


It would appear as though this problem is now resolved.  Maybe I got a bad install of the gem?  Maybe it was just a fluke?  Who knows?  It appears safe to install the latest libxml-ruby now though.

Posted in ruby at March 6th, 2009. No Comments.