uninitialized constant XML::Document

Hi

   In config/environment.rb you have to add

config.gem "libxml-ruby", :lib=>"xml/libxml", :version=>"=versionnumber"

Sijo

Hi Sijo,

here is the code can you suggest me where is going wrong.More over i am not working on the server. I am just creating simple example on RadRails IDE.

require 'xml/libxml'

  doc = XML::Document.new()   doc.root = XML::Node.new('root_node')   doc.root << XML::Node.new('elem1')   puts doc

Chinna.

Hi Sijo,

What i mean is, i created a simple ruby class as follows . And in that class i am trying to crate xml document by 'xml/libxml' lib. Even adding require 'rubygems' also my problum has not solved. I think the libxml gem is not installed properly. How can i check whether the gem is installed properly or not.

class FirstRubyProgram   require 'xml/libxml'   require 'rubygems'

  doc = XML::Document.new()   doc.root = XML::Node.new('root_node')   doc.root << XML::Node.new('elem1')   puts doc end

Direct from the libxml-ruby rdocs: