我在shipping
这里找到了 ruby 的 gem http://shipping.rubyforge.org/在 google 上搜索有关在 USPS
Ruby on rails 应用程序上集成 API 的一些信息,但是当我安装 gem 并将它添加到Gemfile
我bundle install
时尝试运行我的应用程序或 rake taks 我收到以下错误:
/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>'
我现在已经从我的应用程序中删除了 gem,Gemfile
并且我的应用程序已经启动并正在运行,但是,我什至不知道这个 gem 是否适用于Rails 3
或者即使这个 gem 是否适用于USPS
API。
对此有什么帮助吗?我需要将 USPS Web 工具与我的 Ruby on Rails 3 应用程序集成。
谢谢。