I want to build a chat room using Rails, should I use juggernaut 2 or cramp?

2k views Asked by At

Originally I planned to use Juggernaut, however, it is not compatible with Rails 3. And new Juggernaut 2 seems to be completely independent from Rails, which is not what I want. Then I found cramp, it looks quite neat, but is still under development. So I am just wondering which framework should I use? Or is there a better one? Thanks!

3

There are 3 answers

0
Toby Hede On BEST ANSWER

I have looked at the options for this stuff quite extensively and real-time chat is a bit against the grain of Rails. If you really want to stay inside Rails, then Cramp is probably the best option. I recommend you have a look at this article on Websockets and Rails as well: http://www.igvita.com/2009/12/22/ruby-websockets-tcp-for-the-browser/

Using EventMachine to handle the communication means you are that even though you will still be outside Rails, you are at least in Ruby and can share models and libraries.

I have a Async Rails build on GitHub: https://github.com/tobyhede/AsyncRails

Which is largely based on: https://github.com/igrigorik/async-rails

0
Bernard Potocki On

Well - you could also try Socky: https://github.com/socky/socky-server-ruby

It's ruby-based, and uses WebSocket as base with flash fallback to support most devices. Also it's complete ruby-based so give it a try if you want :)

1
Alex MacCaw On

You're right that the new Juggernaut is de-coupled from Rails, but that doesn't mean you can't use the two together. Juggernaut comes with a Ruby library. Using Juggernaut solves the long-lived connection problem that Toby was talking about.

Any questions about Juggernaut, ping me a line (I'm the creator).