3

FlightAware API にアクセスするために FlightXML2 Ruby ライブラリを実行しようとしています。(ライブラリのコードはこちら: 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

Rails プロジェクトで FlightXML2 を実行するには、次の Gemfile を追加して「xmlparser」および「soap4r」gem をインストールする必要がありました。

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 に答える