简体   繁体   English

NoMethodError:未定义的方法“ <<” net / protocol.rb

[英]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: 我已经将应用程序从2.1升级到ruby到2.4,并且收到以下错误消息:

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. 似乎net / http库中的某些内容已更改。 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. 在第一条@debug_output行引发异常。

You probably need to assure to have gem versions compatible with ruby 2.4. 您可能需要确保宝石版本与ruby 2.4兼容。 There are several issues similar to yours: 有几个与您类似的问题:

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 /usr/lib/ruby/1.9.1/net/protocol.rb:146:在rbuf_fill中的救援中:超时::错误(超时::错误) - /usr/lib/ruby/1.9.1/net/protocol.rb:146:in `rescue in rbuf_fill': Timeout::Error (Timeout::Error) Ruby on rails seed.rb: &#39;&quot;NoMethodError: undefined method `each&#39; for &quot; - Ruby on rails seed.rb: '"NoMethodError: undefined method `each' for " 错误的deploy.rb-“ NoMethodError:nil:NilClass的未定义方法&#39;tail&#39;” - Incorrect deploy.rb - “NoMethodError: undefined method `tail' for nil:NilClass” protocol.rb:153:在`read_nonblock&#39;中:到达文件末尾(EOFError) - protocol.rb:153:in `read_nonblock': end of file reached (EOFError) NoMethodError-template.rb:38:in` <main> &#39;:main:Object的未定义方法“模板”(NoMethodError) - NoMethodError - template.rb:38:in `<main>': undefined method `template' for main:Object (NoMethodError) tictactoedef.rb:221:在comp_block中的block中:nil:NilClass的未定义方法“ []”(NoMethodError) - tictactoedef.rb:221:in `block in comp_block': undefined method `[]' for nil:NilClass (NoMethodError) Ruby extract-testcases.rb:172:in` <main> &#39;:nil:NilClass的未定义方法“键”(NoMethodError) - Ruby extract-testcases.rb:172:in `<main>': undefined method `keys' for nil:NilClass (NoMethodError) spring / application.rb:161未定义的方法&#39;reject!&#39; 对于nil:NilClass(NoMethodError) - spring/application.rb:161 undefined method `reject!' for nil:NilClass (NoMethodError) Schema.rb显示由于对nil:NilClass遵循以下NoMethodError#未定义方法“ []”,因此无法转储表“进度” - Schema.rb display Could not dump table “progresses” because of following NoMethodError # undefined method `[]' for nil:NilClass NoMethodError:在Ruby中运行测试套件时,“ unit / TestTestName.rb”的未定义方法“运行” - NoMethodError: undefined method `run' for “unit/TestTestName.rb” when running testsuite in ruby
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM