2012-11-28 32 views
2

我想運行FlightXML2 Ruby庫來訪問FlightAware API。 (該庫的代碼是在這裏:https://github.com/flightaware/flightxml2-client-ruby如何解決Ruby「沒有這樣的文件加載 - xsd/qname」錯誤?

當包括行庫文件「要求‘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?

回答

1

你需要的是


gem install xmlparser 
gem install soap4r 
+0

感謝您的回覆!這消除了上述例外。我不得不添加一些東西來擺脫後續的錯誤,正如我在答案中詳細說明的那樣。 – SpaceInvader

+0

@SpaceInvader什麼東西 –

2

爲了使FlightXML2在我的Rails項目運行,我必須安裝「XMLParser的」和「SOAP4R」寶石具有以下的Gemfile補充:

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

還添加下列兼容性band-aids:

require 'rexml/document' 
require 'continuation' 

class Symbol 
    def sub(*args) 
    to_s.sub(*args) 
    end 
end 
相關問題