Hi Mehdi,
It will not work, because Goliath is not just a framework like rails, but a web server too, which means that Goliath app should be running in its own instance.
One way two do it is setup a Reverse Proxy in front of your application and redirect the chat requests to the Goliath app and the others to the rails app.
I used the Nginx to achieve it in one of my applications, just google "nginx reverse proxy", but there are others softwares where you can do the same.
Regards,
Thiago