From: Robert Mitwicki Date: 2012-10-25T19:05:18+09:00 Subject: [BUG] undefined method `closed?' for nil:NilClass Hi When I try to run one of my rake where I read body from my response, each time I've got this error message: .rvm/rubies/ruby-1.9.3-head/lib/ruby/1.9.1/net/http.rb:2788:in `stream_check': undefined method `closed?' for nil:NilClass (NoMethodError) I checked that place and there is: 2788 raise IOError, 'attempt to read body out of block' if @socket.closed? to fix the problem I just change it to: 2788 raise IOError, 'attempt to read body out of block' if @socket and @socket.closed? I found few similar problems on some forums but it was in different places but the bugfix is always the same, check @socket before @socket.closed? There is also few more place in http.rb where @socked.closed? appear with checking @socket: 1335 connect if @socket.closed? ... 1344 if @socket.closed? I am not sure but it will be good to fix them all. Best regards mtfk