Of course you are not looking for / faye?

I follow this guide to the letter:

http://net.tutsplus.com/tutorials/ruby/how-to-use-faye-as-a-real-time-push-server-in-rails/

I installed thin faye and wrote the following in the faye.ru file:

require 'faye' bayeux = Faye::RackAdapter.new(:mount => '/faye', :timeout => 25) bayeux.listen(9292) 

But when I start the server on the rack:

 rackup faye.ru -E production -s thin 

The server starts correctly:

 >> Thin web server (v1.5.0 codename Knife) >> Maximum connections set to 1024 >> Listening on 0.0.0.0:9292, CTRL+C to stop 

But when I access any web page, for example "http: // localhost: 9292 /", I get the following message:

 Sure you're not looking for /faye ? 

And neither this tutorial nor Ryan Bates rails cast # 260 provides an explanation of why this is happening. Does anyone have an idea?

I have to say that my project uses the ruby ​​version 1.8.7 (and I can’t switch to 1.9, because some of the gems that I use do not yet support 1.9).

+4
source share
3 answers

Well, in fact, everything is working fine, I just did not understand what Fay was supposed to do.

The Faye server does not replace the Rails server, but complements it. I expected to see the same thing on localhost: 3000 and localhost: 9292.

If someone else is confused, like me, you should simultaneously start both servers:

Rails Server:

  rails server [with your options if any] 

Faye server for processing JS channels:

  rackup faye.ru -s thin -E production 

And users only interact with the rails server (on port 3000) and leave the Faye server in the background.

+5
source

You should still use port 3000 (unless you changed the default port or something else). 9292 is only used for Faye.

Try going to "http: // localhost: 3000"

+2
source

The result looks good to me.

Try to find

 http://localhost:9292/faye.js 

instead

 http://localhost:9292/ 
+1
source

All Articles