bblimke/webmock · error · WebMock::NetConnectNotAllowedError

Real HTTP connections are disabled. Unregistered request: #{

Error message

Real HTTP connections are disabled. Unregistered request: #{request_signature}

What it means

Error "Real HTTP connections are disabled. Unregistered request: #{request_signature}" thrown in bblimke/webmock.

Source

Thrown at lib/webmock/http_lib_adapters/net_http.rb:120

              end
              response.extend Net::WebMockHTTPResponse
              block.call response if block
              response
            end
            super_with_after_request = lambda {
              response = super(request, nil, &nil)
              after_request.call(response)
            }
            if started?
              ensure_actual_connection
              super_with_after_request.call
            else
              start_with_connect {
                super_with_after_request.call
              }
            end
          else
            raise WebMock::NetConnectNotAllowedError.new(request_signature)
          end
        end

        def start_without_connect
          raise IOError, 'HTTP session already opened' if @started
          if block_given?
            begin
              @socket = Net::HTTP.socket_type.new
              @started = true
              return yield(self)
            ensure
              do_finish
            end
          end
          @socket = Net::HTTP.socket_type.new
          @started = true
          self
        end

View on GitHub (pinned to b187df8827)

When it happens

Trigger: Thrown at lib/webmock/http_lib_adapters/net_http.rb:120 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of bblimke/webmock@b187df8827 (2026-08-23). Data as JSON: /api/errors/ddfeed8a5a7f0110. Report an issue: GitHub.