2011-08-23 58 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

用它做了!非常感谢 ! –