Forum: Ruby libxml-ruby

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
A7c287b62d7bcff87fcc7c1799419195?d=identicon&s=25 Mohammad Khan (Guest)
on 2007-03-21 01:58
(Received via mailing list)
[beeplove@vpn ruby-agi-1.1.1]$ irb
irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> require_gem 'libxml-ruby'
=> true
irb(main):003:0> doc = XML::Document.new()
NameError: uninitialized constant XML
        from (irb):3
irb(main):004:0>

'gem list' returns
*** LOCAL GEMS ***

libxml-ruby (0.3.8.4)
    LibXML2 bindings for Ruby


Would anybody plese tell me where I am doing wrong?

Thanks,
Mohammad
45196398e9685000d195ec626d477f0e?d=identicon&s=25 Trans (Guest)
on 2007-03-21 02:45
(Received via mailing list)
On Mar 20, 8:57 pm, "Mohammad Khan" <khan.moham...@acm.org> wrote:
> [beeplove@vpn ruby-agi-1.1.1]$ irb
> irb(main):001:0> require 'rubygems'
> => true
> irb(main):002:0> require_gem 'libxml-ruby'   <-- just initializes the library
> => true

require 'xml/libxml'   <-- loads the lib

T.
A7c287b62d7bcff87fcc7c1799419195?d=identicon&s=25 Mohammad Khan (Guest)
on 2007-03-21 02:50
(Received via mailing list)
[beeplove@vpn ~]$ irb
irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> require_gem 'libxml-ruby'
=> true
irb(main):003:0> require 'xml/libxml'
xml/libxml
LoadError: no such file to load -- xml/libxml
        from /usr/lib/site_ruby/1.8/rubygems/custom_require.rb:22:in
`require__'
        from /usr/lib/site_ruby/1.8/rubygems/custom_require.rb:22:in
`require'
        from (irb):3
irb(main):004:0>
45196398e9685000d195ec626d477f0e?d=identicon&s=25 Trans (Guest)
on 2007-03-21 03:18
(Received via mailing list)
On Mar 20, 9:49 pm, "Mohammad Khan" <khan.moham...@acm.org> wrote:
>         from /usr/lib/site_ruby/1.8/rubygems/custom_require.rb:22:in
> `require'
>         from (irb):3
> irb(main):004:0>

Check your installation of libxml. Look in the gems installation dir
for the libxml-ruby package and see if the xml/libxml.rb file is
there. It's working fine on my machine and I just reinstalled from
scratch to be sure.

You might want to update your version of RubyGems too.

T.
A7c287b62d7bcff87fcc7c1799419195?d=identicon&s=25 Mohammad Khan (Guest)
on 2007-03-21 13:58
(Received via mailing list)
I need, require 'xml/libxml_so' or 'libxml_so' after '"gem 'libxml-ruby'

Looks like gemspec of libxml-ruby doesn't have 'autorequire' parameter.

Thanks,
Mohammad
45196398e9685000d195ec626d477f0e?d=identicon&s=25 Trans (Guest)
on 2007-03-21 14:02
(Received via mailing list)
On Mar 21, 8:57 am, "Mohammad Khan" <khan.moham...@acm.org> wrote:
> I need, require 'xml/libxml_so' or 'libxml_so' after '"gem 'libxml-ruby'
>
> Looks like gemspec of libxml-ruby doesn't have 'autorequire' parameter.

autorequire has been deprecated. So it's doing the right thing there.
But I'm surprised you have to load 'libxml_so'. that seems like a bug
to me.

T.
This topic is locked and can not be replied to.