Accessing the Rails console on PWS

One of the common requests when running Rails apps on Pivotal Web services is how do I get a rails console to do some inspection of my app. In the past, there wasn’t a way to access the terminal, but that was changed with the addition of the ‘cf ssh’ command to the Cloud Foundry cf CLI tool. Theoretically, you would be able to access the rails console once you shelled in. However that’s not the case.

However, there is a work around, by typing the following:

$ cf ssh myapp -t -c “/tmp/lifecycle/launcher /home/vcap/app ‘rails c’ ””

Substitute myapp with the name of your app.

Now admittedly that is a workaround. So a more elegant solution is in the public backlog which is available in this Pivotal Tracker story.  Cloud Foundry, find out what’s under the covers and better yet, make a contribution.

Charles Wu is the Principal Product Manager leading Pivotal Web Services (PWS), the leading publicly hosted instance of Pivotal Cloud Foundry. Previously he focused on mobile and social products at Twitter, Facebook, Yahoo and Motorola. Awarded 5 U.S. patents. He can be found @ccwu on Twitter and charleswu on LinkedIn.