3

我正在尝试运行 FlightXML2 Ruby 库来访问 FlightAware API。(图书馆的代码在这里:https ://github.com/flightaware/flightxml2-client-ruby )

当包含带有“require 'FlightXML2.rb'”行的库文件时,会发生以下异常:

LoadError: no such file to load -- xsd/qname
    from /...PATH TO GEMS.../activesupport-3.2.9/lib/active_support/dependencies.rb:251:in `require'
    from /...PATH TO GEMS.../activesupport-3.2.9/lib/active_support/dependencies.rb:251:in `block in require'
    from /...PATH TO GEMS.../activesupport-3.2.9/lib/active_support/dependencies.rb:236:in `load_dependency'
    from /...PATH TO GEMS.../activesupport-3.2.9/lib/active_support/dependencies.rb:251:in `require'
    from /...PATH TO GEMS.../lib/FlightXML2.rb:1:in `<top (required)>'
    from /...PATH TO GEMS.../activesupport-3.2.9/lib/active_support/dependencies.rb:251:in `require'
    from /...PATH TO GEMS.../activesupport-3.2.9/lib/active_support/dependencies.rb:251:in `block in require'
    from /...PATH TO GEMS.../activesupport-3.2.9/lib/active_support/dependencies.rb:236:in `load_dependency'
    from /...PATH TO GEMS.../activesupport-3.2.9/lib/active_support/dependencies.rb:251:in `require'
    from (irb):2
    from /...PATH TO GEMS.../railties-3.2.9/lib/rails/commands/console.rb:47:in `start'
    from /...PATH TO GEMS.../railties-3.2.9/lib/rails/commands/console.rb:8:in `start'
    from /...PATH TO GEMS.../railties-3.2.9/lib/rails/commands.rb:41:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'

我怀疑这与编写库的 Ruby 1.9 和 1.8 之间的不兼容有关。有没有办法让这个工作与 Ruby 1.9 一起工作?

4

2 回答 2

2

为了让 FlightXML2 在我的 Rails 项目中运行,我必须安装“xmlparser”和“soap4r”gem,并添加以下 Gemfile:

gem 'xmlparser'
gem 'soap4r', :git => 'git://github.com/felipec/soap4r.git'

并添加以下兼容性创可贴:

require 'rexml/document'
require 'continuation'

class Symbol
  def sub(*args)
    to_s.sub(*args)
  end
end
于 2012-11-28T15:48:22.700 回答
1

你需要的是


gem install xmlparser
gem install soap4r
于 2012-11-28T05:05:52.027 回答