This is the sample application for Ruby on Rails Tutorial: Learn Rails by Example by Michael Hartl.
This sample has been modified to run on Cloud Foundry. The cf-autoconfig
gem was added to enable auto-configuration of database connections as described in the Cloud Foundry documentation. The pg
gem was also added to support connection to PostgreSQL database.
After installing in the 'cf' command-line interface for Cloud Foundry, targeting a Cloud Foundry instance, and logging in, the application can be pushed using these commands:
$ cf push
Using manifest file manifest.yml
Creating rails-sample... OK
Creating route rails-sample_aa552.cfapps.io... OK
Binding rails-sample_aa552.cfapps.io to rails-sample... OK
Creating service rails-postgres... OK
Binding rails-postgres to rails-sample... OK
Uploading rails-sample... OK
Starting rails-sample... OK
...
Checking status of app 'rails-sample'...
...
1 of 1 instances running (1 running)
Push successful! App 'rails-sample' available at http://rails-sample-xxxxx.cfapps.io
The application will be pushed using settings in the provided manifest.yml
file. The settings include some random
characters in the host to make sure the URL for the app is unique in the Cloud Foundry environment. The last line of the cf push
command shows the URL that was assigned. Using the provided URL in the urls
field displayed, you can browse
to the running application.