Does PubNub run standalone or as a component of a Ruby on Rails (RoR) application?

Both - you can use PubNub as a standalone mobile/web message bus or as a component of another server app.

Also, see this documented example of using PubNub with Padrino (Ruby Framework) to implement realtime voting.