Quickly setup rvm, ruby, rubygems, apache with passenger ec2 ubuntu

The installation and configuration process of Ruby along with gems, apache2 passenger module is still not straightforward and usually comes with hiccups/issues of dependencies, libraries/config. The author after having experience of these issues, write up the set of commands/setup which you can follow for a smooth setup.