Skip to content

Instantly share code, notes, and snippets.

@yahonda
Created November 19, 2024 00:47
Show Gist options
  • Save yahonda/4c941450eb1d692e1895e21e6310a753 to your computer and use it in GitHub Desktop.
Save yahonda/4c941450eb1d692e1895e21e6310a753 to your computer and use it in GitHub Desktop.
require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
gem "webmock"
# gem "webmock", git: "https://github.com/Earlopain/webmock.git", branch: "net-http-adapter-ruby-3.4"
end
p RUBY_VERSION
WebMock.enable!
WebMock.disable!
@yahonda
Copy link
Author

yahonda commented Nov 19, 2024

$ ruby -w webmock_ruby34.rb 
Fetching gem metadata from https://rubygems.org/...........
Source rubygems repository https://rubygems.org/ or installed locally is ignoring #<Bundler::StubSpecification name=openssl version=3.2.0 platform=ruby> because it is missing extensions
Source rubygems repository https://rubygems.org/ or installed locally is ignoring #<Bundler::StubSpecification name=json version=2.8.2 platform=ruby> because it is missing extensions
Source rubygems repository https://rubygems.org/ or installed locally is ignoring #<Bundler::StubSpecification name=date version=3.4.0 platform=ruby> because it is missing extensions
Resolving dependencies...
"3.4.0"
/home/yahonda/.rbenv/versions/trunk/lib/ruby/gems/3.4.0+1/gems/webmock-3.24.0/lib/webmock/http_lib_adapters/net_http.rb:25:in 'Module#remove_const': constant Net::HTTPSession not defined (NameError)

        Net.send(:remove_const, :HTTPSession)
           ^^^^^
        from /home/yahonda/.rbenv/versions/trunk/lib/ruby/gems/3.4.0+1/gems/webmock-3.24.0/lib/webmock/http_lib_adapters/net_http.rb:25:in 'WebMock::HttpLibAdapters::NetHttpAdapter.disable!'
        from /home/yahonda/.rbenv/versions/trunk/lib/ruby/gems/3.4.0+1/gems/webmock-3.24.0/lib/webmock/webmock.rb:41:in 'block in WebMock.enable!'
        from /home/yahonda/.rbenv/versions/trunk/lib/ruby/gems/3.4.0+1/gems/webmock-3.24.0/lib/webmock/http_lib_adapters/http_lib_adapter_registry.rb:18:in 'Hash#each'
        from /home/yahonda/.rbenv/versions/trunk/lib/ruby/gems/3.4.0+1/gems/webmock-3.24.0/lib/webmock/http_lib_adapters/http_lib_adapter_registry.rb:18:in 'WebMock::HttpLibAdapterRegistry#each_adapter'
        from /home/yahonda/.rbenv/versions/trunk/lib/ruby/gems/3.4.0+1/gems/webmock-3.24.0/lib/webmock/webmock.rb:40:in 'WebMock.enable!'
        from webmock_ruby34.rb:10:in '<main>'
$

@yahonda
Copy link
Author

yahonda commented Nov 19, 2024

$ ruby -w webmock_ruby34.rb 
Fetching gem metadata from https://rubygems.org/...........
Resolving dependencies...
"3.3.6"
$

@yahonda
Copy link
Author

yahonda commented Nov 19, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment