gpt4 book ai didi

ruby - soap4r - 未初始化的常量 REXML::Element

转载 作者:数据小太阳 更新时间:2023-10-29 08:33:12 25 4
gpt4 key购买 nike

我正在尝试在我的 Rails 项目(ruby 版本 1.9.3)中使用 soap4r 和 jira4r

在 Gemfile 中我有:

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

当我尝试在我的模型中运行时

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

我得到一个错误:

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'

但如果我在独立的非 Rails ruby​​ 项目中运行相同的代码,它会正常工作。

我该如何解决?

最佳答案

通过添加修复

require 'rexml/document'

关于ruby - soap4r - 未初始化的常量 REXML::Element,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13001872/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com