From: "Jesús Gabriel y Galán" Date: 2010-07-28T18:05:36+09:00 Subject: Re: Chat client On Tue, Jul 27, 2010 at 11:46 PM, Daniel Flores wrote: > hello i was learning about ruby and on the book  i am reading it shows > the part where i can create a chatserver with Gserver > > well lookingon the internet shows the server code everywhere. > > but when i am trying to do a chat client it always failed on me. > i wouldl ike that it works like a conection with telnet or with netcat. > > here is the failling code: > > require 'socket'      # Sockets are in standard library > > host = 'localhost' > port = 1234 > > while line = s.gets   # Read lines from the socket >  puts line      # And print with platform line terminator >  s.puts gets > end > s.puts "Connection close!!" > s.close For me this code fails with this error: test_socket.rb:6: undefined local variable or method `s' for main:Object (NameError) obviously, because you haven't assign anything to s. Do you have a different version of your program, and what are the errors you are getting? Jesus.