I am on Ubuntu 6.10 as well, installed libxml as you proposed:
"gem install -r libxml-ruby"

~$ gem list --local | grep xml
libxml-ruby (0.3.8.4)

So version is 0.3.8.4
Your code runs without problems here.
xmlroot.child.each is available here, too

I don't think you need the
require 'xml/libxml_so'
because this line is included in
/usr/lib/ruby/gems/1.8/gems/libxml-ruby-0.3.8.4/lib/xml/libxml.rb

If your ruby does not find libxml_so, you could check if it is available in
/usr/lib/ruby/gems/1.8/gems/libxml-ruby-0.3.8.4/lib/xml/libxml_so.so

But I have several further lixm packages installed:
~$ dpkg -l | grep libxml
ii  libxml++2.6c2a                         2.14.0-0ubuntu1
A C++ interface to the GNOME XML library (li
ii  libxml-grove-perl                      0.46alpha-11
Perl module for accessing parsed *ML instanc
ii  libxml-parser-perl                     2.34-4
Perl module for parsing XML files
ii  libxml-perl                            0.08-1
Perl modules for working with XML
ii  libxml1                                1.8.17-13
GNOME XML library
ii  libxml2                                2.6.27.dfsg-1ubuntu1
GNOME XML library
ii  libxml2-dev                            2.6.27.dfsg-1ubuntu1
Development files for the GNOME XML library
ii  libxml2-utils                          2.6.26.dfsg-2ubuntu4
XML utilities
ii  libxmlsec1                             1.2.9-3ubuntu2
XML security library
ii  libxmlsec1-nss                         1.2.9-3ubuntu2
Nss engine for the XML security library
ii  libxmlsec1-openssl                     1.2.9-3ubuntu2
Openssl engine for the XML security library
ii  python-libxml2                         2.6.26.dfsg-2ubuntu4
Python bindings for the GNOME XML library

Do you have libxml2 installed?
Found any solution already?
Silvan


On 2/7/07, TRANS <[EMAIL PROTECTED]> wrote:

On 2/6/07, Thibault Martin-Lagardette <[EMAIL PROTECTED]> wrote:
> Hello all.
>
> As a PHP developer, I recently decided to get to know ruby, and
> wanted, as a beginning, to create a small ruby gmail client, like the
> python one.
>
> Working under Ubuntu 6.10, I installed ruby 1.8 via apt-get, and then
> RubyGems myself.
>
> After beeing able to retrieve the XML atom feed from Gmail, I wanted
> to parse the XML file.
> I didn't want to use Rexml when I saw its performances.
> Thus I installed libxml-ruby via the command: "gem install -r
libxml-ruby".
>
> And now that I want to use it, here's what I get:
>
> -- Snippet --
> /usr/lib/ruby/gems/1.8/gems/libxml-ruby-0.3.8.4/lib/xml/libxml.rb:5:
> uninitialized constant XML
> (NameError)
>        from
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in
> `require'
>        from ./gmail-atom.rb:6
> -- End Snippet --
>
> Here's my little bit of code :
>
> -- Snippet --
> #!/usr/bin/ruby
>
> require 'rubygems'
> require 'open-uri'
> require 'xml/libxml_so' # I tried w/ and w/o it...
> require 'xml/libxml'
>
> open("https://mail.google.com/mail/feed/atom";,
>         :http_basic_authentication => ['login', 'passwd']
>        ) do |content|
>  feed = content.read
>  xmlfeed = XML::Parser.string(feed).parse
>  xmlroot = xmlfeed.root
>  p xmlroot.class
>  p xmlroot.methods.sort
> end
> -- End Snippet --
>
>
> The matter is that xml/libxml doesn't seem to load libxml_so.so which
> is where the XML module is defined...
> Downloading the gem, or the source and building it myself does the same
thing.
> And oh, I tried installing libxml via apt-get, buth it's the 3.4
> version, and without, for instance, the "each" or "first_child"
> methods...
>
> Any idea?

Did you figure this out? I don't think you should need the _so
require. BUt I'm not sure what the issue it.

T.
_______________________________________________
libxml-devel mailing list
libxml-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/libxml-devel

_______________________________________________
libxml-devel mailing list
libxml-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/libxml-devel

Reply via email to