I just ran this code in irb, and it worked without issue.  

Can you provide the specific exception or unexpected results?

On Sun, Apr 08, 2007 at 05:28:07AM +0900, Hey You wrote:
> Well I don't know why the socket can't connect to Google. Here is my
> source code:
> 
> require 'socket'
> h = TCPSocket.new('www.google.ca',80)
> h.print "GET /index.html HTTP/1.0\n\n"
> a = h.read
> puts a
> 
> I tried changing the HTTP to 1.1 but it still doesn't work.
> 
> -- 
> Posted via http://www.ruby-forum.com/.
>