Skip to content

Webmock incompatibility with http gem #176

@tjsousa

Description

@tjsousa

Is this a support request?
No

Describe the bug
NameError:
undefined method perform' for class HTTP::Client'

When LD SDK gem is included in Gemfile of a project using the latest version of Webmock, this error shows up.

To reproduce
Include both LD SDK gem and Webmock in the same project and run RSpec.

Expected behavior
Would expect the client to interact cleanly with http gem.

Logs

Failure/Error: require File.expand_path('../config/environment', __dir__)
NameError:
  undefined method `perform' for class `HTTP::Client'
# ./vendor/bundle/ruby/2.5.0/gems/webmock-3.12.1/lib/webmock/http_lib_adapters/http_rb/client.rb:3:in `alias_method'
# ./vendor/bundle/ruby/2.5.0/gems/webmock-3.12.1/lib/webmock/http_lib_adapters/http_rb/client.rb:3:in `<class:Client>'
# ./vendor/bundle/ruby/2.5.0/gems/webmock-3.12.1/lib/webmock/http_lib_adapters/http_rb/client.rb:2:in `<module:HTTP>'
# ./vendor/bundle/ruby/2.5.0/gems/webmock-3.12.1/lib/webmock/http_lib_adapters/http_rb/client.rb:1:in `<top (required)>'
# ./vendor/bundle/ruby/2.5.0/gems/webmock-3.12.1/lib/webmock/http_lib_adapters/http_rb_adapter.rb:32:in `require'
# ./vendor/bundle/ruby/2.5.0/gems/webmock-3.12.1/lib/webmock/http_lib_adapters/http_rb_adapter.rb:32:in `<top (required)>'
# ./vendor/bundle/ruby/2.5.0/gems/webmock-3.12.1/lib/webmock.rb:49:in `require_relative'
# ./vendor/bundle/ruby/2.5.0/gems/webmock-3.12.1/lib/webmock.rb:49:in `<top (required)>'
# /usr/local/bundle/gems/bundler-2.2.21/lib/bundler.rb:174:in `require'
# ./config/application.rb:17:in `<top (required)>'
# ./config/environment.rb:4:in `require_relative'
# ./config/environment.rb:4:in `<top (required)>'
# ./spec/rails_helper.rb:6:in `require'

SDK version
6.2.0

Language version, developer tools
Ruby 2.5.9

OS/platform
MacOS Big Sur

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions