2011-08-23 76 views
0

我已經找到了shipping寶石紅寶石這裏http://shipping.rubyforge.org/一些信息在谷歌搜索上on Rails應用程序上的Ruby集成USPS API,但是當我安裝了寶石,並將其添加到我的Gemfile,因爲我運行bundle install每當嘗試運行我的應用程序或耙TAKS我得到以下錯誤:如何在USPS API的導軌3上使用紅寶石運輸寶石?

/Users/myusername/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `require': /Users/myusername/.rvm/gems/ruby-1.9.2-p290/gems/shipping-1.6.0/lib/shipping/ups.rb:109: syntax error, unexpected ':', expecting keyword_then or ';' or '\n' (SyntaxError) 
/Users/myusername/.rvm/gems/ruby-1.9.2-p290/gems/shipping-1.6.0/lib/shipping/ups.rb:437: syntax error, unexpected keyword_end, expecting $end 
    from /Users/myusername/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `block in require' 
    from /Users/myusername/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:225:in `block in load_dependency' 
    from /Users/myusername/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:596:in `new_constants_in' 
    from /Users/myusername/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:225:in `load_dependency' 
    from /Users/myusername/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `require' 
    from /Users/myusername/.rvm/gems/ruby-1.9.2-p290/gems/shipping-1.6.0/lib/shipping.rb:47:in `<top (required)>' 
    from /Users/myusername/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.18/lib/bundler/runtime.rb:68:in `require' 
    from /Users/myusername/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.18/lib/bundler/runtime.rb:68:in `block (2 levels) in require' 
    from /Users/myusername/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.18/lib/bundler/runtime.rb:66:in `each' 
    from /Users/myusername/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.18/lib/bundler/runtime.rb:66:in `block in require' 
    from /Users/myusername/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.18/lib/bundler/runtime.rb:55:in `each' 
    from /Users/myusername/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.18/lib/bundler/runtime.rb:55:in `require' 
    from /Users/myusername/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.18/lib/bundler.rb:120:in `require' 
    from /Users/myusername/railsapps/dbh4/config/application.rb:7:in `<top (required)>' 
    from /Users/myusername/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.0.7/lib/rails/commands.rb:15:in `require' 
    from /Users/myusername/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.0.7/lib/rails/commands.rb:15:in `<top (required)>' 
    from script/rails:6:in `require' 
    from script/rails:6:in `<main>' 

我從Gemfile現在創業板取出,我的應用程序啓動並運行,但是,我甚至不知道這個寶石適用於Rails 3或者即使此創業板適用於USPS API。

對此有何幫助?我需要將USPS Web Tools與我的Ruby on Rails 3應用程序集成。

謝謝。

回答

2

航運寶石是舊的,不會與軌道3合作(最後一個版本是October 2009

嘗試https://github.com/Shopify/active_shipping

它支持:

  • UPS
  • USPS
  • 聯邦快遞
  • 加拿大郵政
  • 新西蘭郵政
+0

我應該得到這樣的'供應商/ plugin'目錄或安裝此與'軌道插件插件安裝的git:// github.com/Shopify/active_shipping.git'? –

+1

您只需安裝gem install active_shipping或將gem'active_shipping'添加到您的Gemfile。 – Gazler

+0

用它做了!非常感謝 ! –