Martinos
Martinos

Reputation: 2226

NoMethodError: undefined method `<<' net/protocol.rb

I have upgraded an app to ruby from 2.1 to 2.4 and I got the following error message:

NoMethodError: undefined method `<<' for {:read_timeout=>60, :continue_timeout=>nil, :debug_output=>nil}:Hash
Did you mean?  <
from /Users/me/.rubies/ruby-2.4.3/lib/ruby/2.4.0/net/protocol.rb:219:in `writing'

It seems that something has changed in the net/http library. Anyone knows what changed and/or how to fix it?

def writing
  @written_bytes = 0
  @debug_output << '<- ' if @debug_output
  yield
  @debug_output << "\n" if @debug_output
  bytes = @written_bytes
  @written_bytes = nil
  bytes
end

The exception is raised at the first @debug_output line.

Upvotes: 1

Views: 888

Answers (1)

mrzasa
mrzasa

Reputation: 23327

You probably need to assure to have gem versions compatible with ruby 2.4. There are several issues similar to yours:

Upvotes: 6

Related Questions