From: "Manuel M." Date: 2011-09-30T04:25:30+09:00 Subject: Websocket, http.send: "undefined method `asdfg'" Hello everyone, I just started to learn Ruby. As a learning-by-doing project I chose something with websockets. Maybe a bit ambitious, as I only did some Perl many years ago and had C beginners courses in university.. Anyway, I can be quite stubborn! I successfully connect to a websocket server and can receive its output. However, trying to send it strings (for the handshake) fails. Stripped-down source: ################## EventMachine.run { http = EventMachine::HttpRequest.new("ws://websocketstest.com").get :timeout => 0 http.errback { puts "oops" } http.callback { puts "WebSocket connected!" http.send("asdfg") } ################## Output: websocket.rb:16:in `send': undefined method `asdfg' for # (NoMethodError) ################## This code is posted in several places as an example for using websockets. Included ruby gems: 'rubygems' 'eventmachine' 'em-http-request' 'em-http' "http.send" seems to be recognized and called, I am totally lost why it doesnt transfer the string "asdfg" to "http.send". I am grateful for any hints. Also if etiquette would suggest me to post or format differently. Thank you, Manuel -- Posted via http://www.ruby-forum.com/.