sinatra-websocket icon indicating copy to clipboard operation
sinatra-websocket copied to clipboard

EventMachine::Websocket not initialized?

Open aronchick opened this issue 10 years ago • 3 comments

Have you seen this error at all?

$ thin -R config.ru start
Thin web server (v1.6.3 codename Protein Powder)
Maximum connections set to 1024
Listening on 0.0.0.0:3000, CTRL+C to stop
127.0.0.1 - - [11/May/2015:12:06:36 -0700] "GET / HTTP/1.1" 200 2785 0.0136
2015-05-11 12:06:37 - NameError - uninitialized constant EventMachine::WebSocket::HandlerFactory:

I've required 'em-websocket' and 'sinatra-websocket', I can't think of anything else missing. I'm seeing this after a default clone of this app:

https://github.com/tasermonkey/ruby-nginx-sinatra-thin-websockets

aronchick avatar May 11 '15 19:05 aronchick

Which version of EM are you running?

See if you can get a full stack trace as well.

Sent from my iPhone

On 2015/05/11, at 15:12, David Aronchick [email protected] wrote:

Have you seen this error at all?

$ thin -R config.ru start Thin web server (v1.6.3 codename Protein Powder) Maximum connections set to 1024 Listening on 0.0.0.0:3000, CTRL+C to stop 127.0.0.1 - - [11/May/2015:12:06:36 -0700] "GET / HTTP/1.1" 200 2785 0.0136 2015-05-11 12:06:37 - NameError - uninitialized constant EventMachine::WebSocket::HandlerFactory: I've required 'em-websocket' and 'sinatra-websocket', I can't think of anything else missing. I'm seeing this after a default clone of this app:

https://github.com/tasermonkey/ruby-nginx-sinatra-thin-websockets

― Reply to this email directly or view it on GitHub.

gruis avatar May 11 '15 19:05 gruis

It looks like it was/is the gem version. Once I locked to an earlier version <~ 0.3.1 of em-websocket, it worked.

aronchick avatar May 11 '15 22:05 aronchick

Yes; cf. https://github.com/postrank-labs/goliath/issues/228 . sinatra-websocket is using an old version of the em-websocket API. I've locked in

gem 'em-websocket', '< 0.3.8'

opoudjis avatar Mar 02 '16 03:03 opoudjis