"uninitialized constant REXML::Document"

A pal of mine wrote an application, it runs for him just fine. We are
both running the same versions of Rails and Ruby and apparently the
gems.

When I run his app I get a mysterious “NameError (uninitialized constant
REXML::Document):” (see more of the server console below.)

It’s right at the getgo, at the include REXML.

When check, in IRB and ruby by itself, I have a perfectly fine running
install of REXML.

When I create a hello world Rails app and add a few lines of REXML it
works just fine as well.

Still his app fails on include REXML, even before it starts.

  1. Does anyone have a clue of what I can look at to figure out why?

  2. Do you know where in rails startup the ‘include REXML’ would be
    occurring?

I can add a lot more detail but thought I’d start with the top level
question to see if something jumps out at anyone. Thanks a lot!! (See
below for the console)

  • Pito

Processing ElectionsController#import (for 127.0.0.1 at 2010-01-08
16:13:05) [PUT]
Parameters: {“commit”=>“Import election”,
“importFile”=>#<File:/var/folders/BF/BFIqAzICGVuMEvQQwzRkvE+++TI/-Tmp-/RackMultipart20100108-62565-1sqo1af-0>,
“action”=>“import”, “_method”=>“put”,
“authenticity_token”=>“A0YtW7CFdfVYj2C1lvSCSS3qjvffg3bMBRIrSBxUcK4=”,
“controller”=>“elections”}

NameError (uninitialized constant REXML::Document):
lib/ttv/import_export.rb:115:in import' lib/ttv/import_export.rb:216:inimport’
app/controllers/elections_controller.rb:71:in import' -e:2:inload’
-e:2

Rendered rescues/_trace (31.0ms)
Rendered rescues/_request_and_response (0.4ms)
Rendering rescues/layout (internal_server_error)

Pito S. wrote:

A pal of mine wrote an application, it runs for him just fine.

Check the following file here:

lib/ttv/import_export.rb

See what it’s including at the top of that file and make sure you have
everything it’s asking for.

Thanks…

Alpha B. wrote:

Check the following file here:

lib/ttv/import_export.rb

See what it’s including at the top of that file and make sure you have
everything it’s asking for.

Here’s the file:
http://github.com/trustthevote/ElectionManager/blob/master/lib/ttv/import_export.rb

You see, it doesn’t require or include anything… I have to assume
that somehow implicitly or explicitly REXML is included and required
elsewhere but not sure how to troubleshoot that…

– Pito