I was running tests that called Shippo::Address.create, mocking the API call with webmock, and I kept getting the following error:
Shippo::API::Request: Internal error occurred while connecting to https://api.goshippo.com/addresses/: key not found: :ciphers
Stack Trace
/Users/cfranklin/.rvm/gems/ruby-2.5.1/gems/rest-client-1.8.0/lib/restclient/request.rb:163:in `fetch'
/Users/cfranklin/.rvm/gems/ruby-2.5.1/gems/rest-client-1.8.0/lib/restclient/request.rb:163:in `initialize'
/Users/cfranklin/.rvm/gems/ruby-2.5.1/gems/rest-client-1.8.0/lib/restclient/request.rb:41:in `new'
/Users/cfranklin/.rvm/gems/ruby-2.5.1/gems/rest-client-1.8.0/lib/restclient/request.rb:41:in `execute'
/Users/cfranklin/.rvm/gems/ruby-2.5.1/gems/shippo-2.0.8/lib/shippo/api/request.rb:107:in `make_request!'
/Users/cfranklin/.rvm/gems/ruby-2.5.1/gems/shippo-2.0.8/lib/shippo/api/request.rb:103:in `shippo_phone_home'
/Users/cfranklin/.rvm/gems/ruby-2.5.1/gems/shippo-2.0.8/lib/shippo/api/request.rb:56:in `execute'
/Users/cfranklin/.rvm/gems/ruby-2.5.1/gems/shippo-2.0.8/lib/shippo/api.rb:30:in `request'
/Users/cfranklin/.rvm/gems/ruby-2.5.1/gems/shippo-2.0.8/lib/shippo/api.rb:36:in `block (2 levels) in singleton class'
/Users/cfranklin/.rvm/gems/ruby-2.5.1/gems/shippo-2.0.8/lib/shippo/api/operations/create.rb:14:in `create'
/Users/cfranklin/Repos/marketplacer_projects/marketshipper/shipping_brokers/shippo.rb:19:in `fetch_shipping_rates'
/Users/cfranklin/Repos/marketplacer_projects/marketshipper/spec/shipping_brokers/shippo_spec.rb:95:in `block (3 levels) in <top (required)>'
/Users/cfranklin/.rvm/gems/ruby-2.5.1/gems/rspec-core-3.8.0/lib/rspec/core/example.rb:254:in `instance_exec'
/Users/cfranklin/.rvm/gems/ruby-2.5.1/gems/rspec-core-3.8.0/lib/rspec/core/example.rb:254:in `block in run'
/Users/cfranklin/.rvm/gems/ruby-2.5.1/gems/rspec-core-3.8.0/lib/rspec/core/example.rb:500:in `block in with_around_and_singleton_context_hooks'
/Users/cfranklin/.rvm/gems/ruby-2.5.1/gems/rspec-core-3.8.0/lib/rspec/core/example.rb:457:in `block in with_around_example_hooks'
/Users/cfranklin/.rvm/gems/ruby-2.5.1/gems/rspec-core-3.8.0/lib/rspec/core/hooks.rb:464:in `block in run'
/Users/cfranklin/.rvm/gems/ruby-2.5.1/gems/rspec-core-3.8.0/lib/rspec/core/hooks.rb:602:in `run_around_example_hooks_for'
/Users/cfranklin/.rvm/gems/ruby-2.5.1/gems/rspec-core-3.8.0/lib/rspec/core/hooks.rb:464:in `run'
/Users/cfranklin/.rvm/gems/ruby-2.5.1/gems/rspec-core-3.8.0/lib/rspec/core/example.rb:457:in `with_around_example_hooks'
/Users/cfranklin/.rvm/gems/ruby-2.5.1/gems/rspec-core-3.8.0/lib/rspec/core/example.rb:500:in `with_around_and_singleton_context_hooks'
/Users/cfranklin/.rvm/gems/ruby-2.5.1/gems/rspec-core-3.8.0/lib/rspec/core/example.rb:251:in `run'
/Users/cfranklin/.rvm/gems/ruby-2.5.1/gems/rspec-core-3.8.0/lib/rspec/core/example_group.rb:629:in `block in run_examples'
/Users/cfranklin/.rvm/gems/ruby-2.5.1/gems/rspec-core-3.8.0/lib/rspec/core/example_group.rb:625:in `map'
/Users/cfranklin/.rvm/gems/ruby-2.5.1/gems/rspec-core-3.8.0/lib/rspec/core/example_group.rb:625:in `run_examples'
/Users/cfranklin/.rvm/gems/ruby-2.5.1/gems/rspec-core-3.8.0/lib/rspec/core/example_group.rb:591:in `run'
/Users/cfranklin/.rvm/gems/ruby-2.5.1/gems/rspec-core-3.8.0/lib/rspec/core/example_group.rb:592:in `block in run'
/Users/cfranklin/.rvm/gems/ruby-2.5.1/gems/rspec-core-3.8.0/lib/rspec/core/example_group.rb:592:in `map'
/Users/cfranklin/.rvm/gems/ruby-2.5.1/gems/rspec-core-3.8.0/lib/rspec/core/example_group.rb:592:in `run'
/Users/cfranklin/.rvm/gems/ruby-2.5.1/gems/rspec-core-3.8.0/lib/rspec/core/runner.rb:116:in `block (3 levels) in run_specs'
/Users/cfranklin/.rvm/gems/ruby-2.5.1/gems/rspec-core-3.8.0/lib/rspec/core/runner.rb:116:in `map'
/Users/cfranklin/.rvm/gems/ruby-2.5.1/gems/rspec-core-3.8.0/lib/rspec/core/runner.rb:116:in `block (2 levels) in run_specs'
/Users/cfranklin/.rvm/gems/ruby-2.5.1/gems/rspec-core-3.8.0/lib/rspec/core/configuration.rb:1989:in `with_suite_hooks'
/Users/cfranklin/.rvm/gems/ruby-2.5.1/gems/rspec-core-3.8.0/lib/rspec/core/runner.rb:111:in `block in run_specs'
/Users/cfranklin/.rvm/gems/ruby-2.5.1/gems/rspec-core-3.8.0/lib/rspec/core/reporter.rb:74:in `report'
/Users/cfranklin/.rvm/gems/ruby-2.5.1/gems/rspec-core-3.8.0/lib/rspec/core/runner.rb:110:in `run_specs'
/Users/cfranklin/.rvm/gems/ruby-2.5.1/gems/rspec-core-3.8.0/lib/rspec/core/runner.rb:87:in `run'
/Users/cfranklin/.rvm/gems/ruby-2.5.1/gems/rspec-core-3.8.0/lib/rspec/core/runner.rb:71:in `run'
/Users/cfranklin/.rvm/gems/ruby-2.5.1/gems/rspec-core-3.8.0/lib/rspec/core/runner.rb:45:in `invoke'
/Users/cfranklin/.rvm/gems/ruby-2.5.1/gems/rspec-core-3.8.0/exe/rspec:4:in `<top (required)>'
/Users/cfranklin/.rvm/gems/ruby-2.5.1/bin/rspec:23:in `load'
/Users/cfranklin/.rvm/gems/ruby-2.5.1/bin/rspec:23:in `<main>'
/Users/cfranklin/.rvm/gems/ruby-2.5.1/bin/ruby_executable_hooks:24:in `eval'
/Users/cfranklin/.rvm/gems/ruby-2.5.1/bin/ruby_executable_hooks:24:in `<main>'
Some googling led me to this issue on the rest-client repo: https://github.com/rest-client/rest-client/issues/612, which fixed the issue in v 2.0.1. I forked the shippo-ruby-client repo and made the minimum version of rest-client 2.0.2, which is the version in the Gemfile.lock when I installed the dependencies on my computer. Using that branch instead of the rubygems version works as intended.
I was running tests that called
Shippo::Address.create
, mocking the API call withwebmock
, and I kept getting the following error:Some googling led me to this issue on the
rest-client
repo: https://github.com/rest-client/rest-client/issues/612, which fixed the issue in v 2.0.1. I forked theshippo-ruby-client
repo and made the minimum version ofrest-client
2.0.2, which is the version in theGemfile.lock
when I installed the dependencies on my computer. Using that branch instead of the rubygems version works as intended.I'm happy to open a PR for my fork.