# Oddness with gems

**URL:** <https://www.ruby-forum.com/t/oddness-with-gems/153200>\
**Category:** Ruby\
**Created:** [November 13, 2008, 10:53am UTC](https://www.ruby-forum.com/t/oddness-with-gems/153200 "2008-11-13T10:53:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tekhne](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/90ced4/32.png) [@tekhne](https://www.ruby-forum.com/u/tekhne)\
**Post date:** [November 13, 2008, 10:53am UTC](https://www.ruby-forum.com/t/oddness-with-gems/153200/1 "2008-11-13T10:53:01Z")

</div>

I am running 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32] and I  
installed the libxslt and libxml gems so that I could play with some  
xslt. I set up this code:

#!/usr/bin/ruby

require ‘rubygems’

require ‘libxslt’  
require ‘libxml’

# Create a new XSL Transform

stylesheet\_doc = XML::Document.file(‘browse.xsl’)  
stylesheet = LibXSLT::Stylesheet.new(stylesheet\_doc)

# Transform a xml document

xml\_doc = XML::Document.file(‘page.xml’)  
result = stylesheet.apply(xml\_doc)

puts result

But when I run it I get uninitialized constant XML (NameError). Any idea  
how to go about debugging this?

Sorry I’m being so thick today.

---

<div class="post-metadata">

**Author:** ![tekhne](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/90ced4/32.png) [@tekhne](https://www.ruby-forum.com/u/tekhne)\
**Post date:** [November 13, 2008, 4:51pm UTC](https://www.ruby-forum.com/t/oddness-with-gems/153200/2 "2008-11-13T16:51:08Z")

</div>

Peter H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> # Transform a xml document
> 
> xml\_doc = XML::Document.file(‘page.xml’)  
> result = stylesheet.apply(xml\_doc)
> 
> puts result
> 
> But when I run it I get uninitialized constant XML (NameError). Any idea  
> how to go about debugging this?

The namespace changed. It is now called LibXML::XML::Document (and so  
on). m.

---

<div class="post-metadata">

**Author:** ![tekhne](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/90ced4/32.png) [@tekhne](https://www.ruby-forum.com/u/tekhne)\
**Post date:** [November 13, 2008, 4:57pm UTC](https://www.ruby-forum.com/t/oddness-with-gems/153200/3 "2008-11-13T16:57:00Z")

</div>

Ah, thanks for that. Will get on with things now.

Thanks you
