[Instantrails-users] REXML question

Curt Hibbs curt.hibbs at gmail.com
Fri Apr 28 18:03:39 EDT 2006


On 4/28/06, Bill Walton <bill.walton at charter.net> wrote:
>
> Is REXML included in the InstantRails 1.3 build?  Does it work via irb?
> I'm trying to work through the tutorial at
> http://www.germane-software.com/software/rexml/docs/tutorial.html and
> thought I'd try irb at the same time.  But right off, I run into the
> 'unitialized constant Document' error shown below.  Any ideas?
>
> Thanks,
> Bill
>
> -------------- irb input/output --------------
> C:\InstantRails-1.3\rails_apps\sandbox>irb
> irb(main):001:0> require "rexml/document"
> => true
> irb(main):002:0> file=File.new("public/mydoc.xml")
> => #<File:public/mydoc.xml>
> irb(main):003:0> doc=Document.new file
> NameError: uninitialized constant Document
>         from (irb):3
> irb(main):004:0>
>


REXML is inlcuded in Ruby. I just looked at REXML's document.rb file (in
lib\ruby\1.8\xml) and the Document class is defined inside of a module named
REXML. So you need to do this:

   doc = REXML::Document.new

Curt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/instantrails-users/attachments/20060428/ecd7de9d/attachment.htm 


More information about the Instantrails-users mailing list