On Jan 27, 2011, at 3:11 PM, Doug Blackman wrote:

> Hi,
> 
> I programmed years before with .Net, Java, etc. and haven't had any
> exposure to Ruby yet.  Since I have a background in CS, I can kinda
> follow what's going on but I'm stuck with this.
> 
> I have taken over support for a website within our company that allows
> users to submit requests.  When they submit a request, they are sent an
> email through our Exchange server with the request details.  I'm getting
> an error in the Ruby code that sends the emails.  Any help would be
> appreciated.
> 
> I've attached a copy of the error and the ruby code where the error is
> happening.

Take a look at the docs here:

http://ruby-doc.org/core/classes/IO.html#M000920

The call to "f.gets" is trying to read the next string from the IO object (in this case it's a TCPSocket). The docs say you'll get nil when you hit EOF. You can't call #chomp (or most other methods) on NilClass without it throwing up its hands and exiting.

I'm assuming you are getting EOF here because the socket connection has been interrupted or dropped. Perhaps a router or firewall change is related? Alternately, perhaps the peer (the guy on the other end of this socket) is sending malformed messages. This is hard to debug without knowing all of the pieces.

cr