# Roxml in non-rails?

**URL:** <https://www.ruby-forum.com/t/roxml-in-non-rails/160112>\
**Category:** Ruby\
**Created:** [February 11, 2009, 10:03pm UTC](https://www.ruby-forum.com/t/roxml-in-non-rails/160112 "2009-02-11T22:03:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pitosalas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a4c791/32.png) [@pitosalas](https://www.ruby-forum.com/u/pitosalas)\
**Post date:** [February 11, 2009, 10:03pm UTC](https://www.ruby-forum.com/t/roxml-in-non-rails/160112/1 "2009-02-11T22:03:29Z")

</div>

I have to generate some xml and have been doing a bit of a survey of  
available libraries.

Roxml seems good to me. But I can’t get it to work. Does it depend in  
some subtle way on Rails?

For example, this simple code doesn’t work for me:

require ‘rubygems’  
require ‘roxml’

module Opml  
attr\_accessor :text, :type, :xmlUrl

class Outline  
include ROXML  
xml\_reader :text  
xml\_reader :type  
xml\_reader :xmlUrl  
end  
end

include Opml

x = Outline.new  
x.text = “abbc”  
puts x.to\_xml

… It throws: undefined method â€˜new\_elementâ€™ for  
LibXML::XML::Node:Class

Anyone know?

---

<div class="post-metadata">

**Author:** ![pitosalas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a4c791/32.png) [@pitosalas](https://www.ruby-forum.com/u/pitosalas)\
**Post date:** [February 19, 2009, 3:29am UTC](https://www.ruby-forum.com/t/roxml-in-non-rails/160112/2 "2009-02-19T03:29:09Z")

</div>

On Feb 11, 4:02 pm, Pito S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> –  
> Posted viahttp://www.ruby-forum.com/.

Hey Pito,

Unfortunately, I’d had an old copy of libxml installed outside of  
rubygems which was conflicting and overriding my more recent rubygems  
versions, so I was only testing against the old 0.8.3 version.

Once I corrected that, I was able to reproduce your problem, and I’ve  
since fixed it on my development branch ([Empact (Benjamin Woosley) · GitHub](http://github.com/Empact/)  
roxml/). You can get it there, or wait a bit for the official 2.5 to  
go up on rubyforge.

Thanks for the post!
