On 25 Oct 2012, at 04:05, Robert Mitwicki <robert.mitwicki / fxitech.com> wrot=
e:

> Hi
>=20
> When I try to run one of my rake where I read body from my response,
> each time I've got this error message:
>=20
> .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)
>=20
> I checked that place and there is:
>=20
> 2788       raise IOError, 'attempt to read body out of block' if @socket.c=
losed?
>=20
> to fix the problem I just change it to:
>=20
> 2788       raise IOError, 'attempt to read body out of block' if
> @socket and @socket.closed?
>=20
> 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:
>=20
> 1335       connect if @socket.closed?
> ...
> 1344       if @socket.closed?
>=20
> I am not sure but it will be good to fix them all.
>=20
> Best regards
> mtfk


What are you wanting fixed? As I'm reading your issue, a nil is seen and app=
ropriately raises an undefined method error.=20

If you can resolve the circumstances under which nil sockets can possibly oc=
cur, you have a permanent solution. Til then, you should check for nils.=20

Jamandbees.=20=