rubysoap4r

soap4r - uninitialized constant REXML::Element


i am trying to use soap4r and jira4r in my rails project (ruby version 1.9.3)

in Gemfile i have:

gem 'soap4r', :git => 'git://github.com/felipec/soap4r.git'
gem 'jira4r-jh'

when i try to run in my model

require "jira4r/jira-tool"

model Mymodel

  def mydef

    jira = Jira4R::JiraTool.new(2, "http://my.website.com/")
    jira.login("test@test.com","password")

  end
end

i get an error:

uninitialized constant REXML::Element

rubyjedi-soap4r (1.5.8.01) lib/soap/mapping/mapping.rb:129:in `_obj2soap'
rubyjedi-soap4r (1.5.8.01) lib/soap/mapping/mapping.rb:54:in `block (2 levels) in objs2soap'
rubyjedi-soap4r (1.5.8.01) lib/soap/mapping/mapping.rb:52:in `upto'
rubyjedi-soap4r (1.5.8.01) lib/soap/mapping/mapping.rb:52:in `block in objs2soap'
rubyjedi-soap4r (1.5.8.01) lib/soap/mapping/mapping.rb:560:in `block in protect_mapping'
rubyjedi-soap4r (1.5.8.01) lib/soap/mapping/mapping.rb:533:in `protect_threadvars'
rubyjedi-soap4r (1.5.8.01) lib/soap/mapping/mapping.rb:549:in `protect_mapping'
rubyjedi-soap4r (1.5.8.01) lib/soap/mapping/mapping.rb:51:in `objs2soap'
rubyjedi-soap4r (1.5.8.01) lib/soap/rpc/proxy.rb:475:in `request_rpc_enc'
rubyjedi-soap4r (1.5.8.01) lib/soap/rpc/proxy.rb:457:in `request_rpc'
rubyjedi-soap4r (1.5.8.01) lib/soap/rpc/proxy.rb:412:in `request_body'
rubyjedi-soap4r (1.5.8.01) lib/soap/rpc/proxy.rb:127:in `call'
rubyjedi-soap4r (1.5.8.01) lib/soap/rpc/driver.rb:151:in `call'

but if i run same code in stand-alone non-rails ruby project it works properly.

how can i fix it?


Solution

  • fixed by adding

    require 'rexml/document'