From: Brian Candler Date: 2011-10-03T17:31:20+09:00 Subject: Re: Websocket, http.send: "undefined method `asdfg'" Manuel M. wrote in post #1024484: > I looked more into 'send', 'write', 'print' and more. They work as > intended (I can send a string to a http connection) when I open a > connection with TCPSocket. TCPSocket has its own 'send' method, which overrides Object#send and does something different (write data, not invoke a method) > No chance when trying it inside the posted > EventMachine. So use 'write' instead of 'send', as was suggested. > test.rb:17:in `send': undefined method `GET /index.html HTTP/1.1 > (NoMethodError) Correct. The same is true of any object: irb(main):001:0> myobject = "hello" => "hello" irb(main):002:0> myobject.send("GET /index.html HTTP/1.1") NoMethodError: undefined method `GET /index.html HTTP/1.1' for "hello":String from (irb):2:in `send' from (irb):2 from :0 - except for the few classes which (perhaps confusingly) override Object#send to do something else. -- Posted via http://www.ruby-forum.com/.