gruis / sinatra-websocket

Makes it easy to upgrade any request to a websocket connection in Sinatra
https://rubygems.org/gems/sinatra-websocket
Other
230 stars 31 forks source link

EventMachine::Websocket not initialized? #16

Open aronchick opened 9 years ago

aronchick commented 9 years ago

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

gruis commented 9 years ago

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 notifications@github.com 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.

aronchick commented 9 years ago

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

opoudjis commented 8 years ago

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'