Can anyone tell me what is the best Ruby chat gem/plugin that is compatible with Heroku? Can Node.js be used for this and does Node.js play nice with Rails 3?
-
1What sorts of features are you looking for in a chat gem? – Andrew May 31 '12 at 05:06
-
Thank you for the descriptive answer below. Nothing specific to be exact. Something that can push notifications (most chat programs have this) to end-users when people send messages to one another. Something that is compatible with Heroku too to be exact. Those are the 2 essential traits I'm looking for at the moment. Anything else is just a plus. – RubyFanatic May 31 '12 at 16:53
-
What do you think of Node.js with Rails for this chat purpose? – RubyFanatic May 31 '12 at 18:15
-
1Node.js would be fine, but since Node.js is JavaScript and Rails is Ruby, you need something to tie them together. This is usually done with a database (like Redis). I prefer to keep it all in Ruby if I have the option. When you say "push notifications" do you mean your application has private messages, and you just want an ajaxy way to notify them when they have received one? Or are you trying to implement a one-to-one instant messaging between users of your application? – Andrew May 31 '12 at 19:54
-
Yes I usually prefer to keep everything Ruby as much as possible. Node.js is more like a last resort for me. I'm trying to implement a one-on-one instant message feature. – RubyFanatic May 31 '12 at 20:06
2 Answers
I am working on upgrading my open source chat gem to be Heroku compatible (soon, hopefully). It's called Mad Chatter. Soon you will be able to easily integrate it with any Rails application.
Heroku supports HTTP long polling, but does not support web sockets. Web Sockets are a great new technology, but until Heroku supports it, you will want to look for gems that support long polling.
One popular solution is to use Socket.io, but it is meant for running on node.js. Juggernaut works like this (as a node.js server) except that it stores each message in a Redis database so that you can access them from Ruby. My only criticism of Juggernaut is that there are so many pieces involved to get it up and running.
Faye is a library which supports long polling and is available as a pure Ruby implementation which can optionally use Redis to store messages. I'm opting to use Faye because there are simply less deployment dependencies.
I'm sure there are other options but I know that Faye is a pretty popular solution. That being said, these are just the communication gems. They are only the foundation of your chat app. There are a few different "chat gem" options depending on the types of features you need. But by using Faye, you could implement your own simple chat app.

- 227,796
- 193
- 515
- 708
The Juggernaut plugin for Ruby on Rails aims to revolutionize your Rails app by letting the server initiate a connection and push data to the client. http://juggernaut.rubyforge.org/.