ryanb/private_pub — Issue #39: undefined method `close_connection_after_writing' for nil:NilClass (NoMethodError)
Author: gitt
Created: 2012-02-28 20:58:03+00:00
State: open

I'm having an issue getting private_pub up and running. The error below happens when the browser attempts make a POST request to http://localhost:9292/faye. This was confirmed in FF 10.02, and Chrome 17. I'm also running this on OSX 10.7.3.

Sample app can be found @ https://github.com/gitt/private_pub_test

I also noticed that in my javascript console, I get the error.

```text
Error during WebSocket handshake: 'Upgrade' header is missing
```

I've setup a very simple test app, that only subscribes to a channel, and nothing else. It includes the thin, and private pub gems. This might be a faye issue, so I'll link this issue to them as well, just in case.

```text
/Users/mike/.rvm/gems/ruby-1.9.2-head@private_pub_test/gems/faye-websocket-0.4.1/lib/faye/websocket/api.rb:75:in `block in close': undefined method `close_connection_after_writing' for nil:NilClass (NoMethodError)
from /Users/mike/.rvm/gems/ruby-1.9.2-head@private_pub_test/gems/faye-websocket-0.4.1/lib/faye/websocket/api.rb:89:in `call'
from /Users/mike/.rvm/gems/ruby-1.9.2-head@private_pub_test/gems/faye-websocket-0.4.1/lib/faye/websocket/api.rb:89:in `close'
from /Users/mike/.rvm/gems/ruby-1.9.2-head@private_pub_test/gems/faye-websocket-0.4.1/lib/faye/websocket.rb:177:in `fail'
from /Users/mike/.rvm/gems/ruby-1.9.2-head@private_pub_test/gems/thin-1.3.1/lib/thin/connection.rb:155:in `unbind'
from /Users/mike/.rvm/gems/ruby-1.9.2-head@private_pub_test/gems/eventmachine-1.0.0.beta.4/lib/eventmachine.rb:1397:in `event_callback'
from /Users/mike/.rvm/gems/ruby-1.9.2-head@private_pub_test/gems/eventmachine-1.0.0.beta.4/lib/eventmachine.rb:179:in `run_machine'
from /Users/mike/.rvm/gems/ruby-1.9.2-head@private_pub_test/gems/eventmachine-1.0.0.beta.4/lib/eventmachine.rb:179:in `run'
from /Users/mike/.rvm/gems/ruby-1.9.2-head@private_pub_test/gems/thin-1.3.1/lib/thin/backends/base.rb:61:in `start'
from /Users/mike/.rvm/gems/ruby-1.9.2-head@private_pub_test/gems/thin-1.3.1/lib/thin/server.rb:159:in `start'
from /Users/mike/.rvm/gems/ruby-1.9.2-head@private_pub_test/gems/rack-1.3.6/lib/rack/handler/thin.rb:13:in `run'
from /Users/mike/.rvm/gems/ruby-1.9.2-head@private_pub_test/gems/rack-1.3.6/lib/rack/server.rb:265:in `start'
from /Users/mike/.rvm/gems/ruby-1.9.2-head@private_pub_test/gems/rack-1.3.6/lib/rack/server.rb:137:in `start'
from /Users/mike/.rvm/gems/ruby-1.9.2-head@private_pub_test/gems/rack-1.3.6/bin/rackup:4:in `'
from /Users/mike/.rvm/gems/ruby-1.9.2-head@private_pub_test/bin/rackup:19:in `load'
from /Users/mike/.rvm/gems/ruby-1.9.2-head@private_pub_test/bin/rackup:19:in `

'
```