I’m getting the above error in a gem with this code snippet
Savon.configure do |config|
config.log = false
config.log_level = :error
HTTPI.log = false
end
This code used to pass in past runs on Travis, so I’m not sure why this changed when I altered the Readme.
Part of this confusion comes from my situation–inheriting a gem to maintain–along with this line in the gemspec:
There’s no version number specified, so the newest run switched over to using Savon 2, which ditched the
Savon.configureglobal behavior. If you’re in the same boat as me, changing this line to the last pre-2.0 version of Savon will resolve the issue:Then
bundle installand you should be good.Or you want to upgrade your code. I know I do.
Savon.configurewas removed from Savon 2.0 because the “problem was global state“. The quickest way to keep the behavior the same in your app would be to define a app-level global hash in the same place. You’d then pass this hash into everySavon.clientcall you make. For instance:I’d consider this a starting point to migrating to the 2.0 configuration style. Ideally, you should always consider the client-specific 2.0 options available when initializing each Savon client.