Building libxml-ruby gem on Ubuntu Hardy

Source: Tibs’ Blog

I had been having a lot of trouble using libxml-ruby on Ubuntu Hardy for a hobby project of mine. Any task including libxml calls via require 'xml/libxml' fails with the message:
no such file to load -- libxml_so.To solve this:

 

  1. sudo apt-get install libxml2 libxml2-dev
  2. cd /usr/lib/ruby/gems/1.8/gems/libxml-ruby-0.7.0
  3. sudo ruby ext/libxml/extconf.rb
  4. sudo make; sudo make install

One Response

  1. Jimmy Zimmerman Says:

    Thank you for posting this!

    Just a warning to other Ubuntu users, the apt package libxml-ruby is OLD, so it may break you if you’ve been developing on newer versions. I found the following works to get the latest gem:

    sudo apt-get install libxml2 libxml2-dev
    sudo gem install libxml-ruby

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.