Windycityrails-dojo-chat-server is a project mainly written in RUBY and JAVASCRIPT, it's free.
For instructions on getting started with the Dojo head over to this github repositorie's wiki!