Coder Social home page Coder Social logo

riding-rails's Introduction

Riding Rails Tutorial

Sample application for Ruby on Rails

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.

Running the application on Cloud Foundry

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:

First, view a list of services and plans available in your Cloud Foundry instance:

$ cf marketplace
Getting services from marketplace
OK

service          plans                                                                 description
blazemeter       free-tier, basic1kmr, pro5kmr, pp10kmr, hv40kmr                       The JMeter Load Testing Cloud
cleardb          spark, boost, amp, shock                                              Highly available MySQL for your Apps.
cloudamqp        lemur, tiger, bunny, rabbit, panda                                    Managed HA RabbitMQ servers in the cloud
cloudforge       free, standard, pro                                                   Development Tools In The Cloud
elephantsql      turtle, panda, hippo, elephant                                        PostgreSQL as a Service
ironmq           pro_platinum, pro_gold, large, medium, small, pro_silver              Powerful Durable Message Queueing Service
ironworker       large, pro_gold, pro_platinum, pro_silver, small, medium              Scalable Background and Async Processing
loadimpact       lifree, li100, li500, li1000                                          Automated and on-demand performance testing
memcachedcloud   25mb, 100mb, 250mb, 500mb, 1gb, 2-5gb, 5gb                            Enterprise-Class Memcached for Developers
mongolab         sandbox                                                               Fully-managed MongoDB-as-a-Service
newrelic         standard                                                              Manage and monitor your apps
rediscloud       25mb, 100mb, 250mb, 500mb, 1gb, 2-5gb, 5gb, 10gb, 50gb                Enterprise-Class Redis for Developers
searchify        small, plus, pro                                                      Custom search you control
searchly         small, micro, professional, advanced, starter, business, enterprise   Search Made Simple. Powered-by ElasticSearch
sendgrid         free, bronze, silver, gold, platinum                                  Email Delivery. Simplified.

Choose a PostgreSQL service from the list and create a service instance named rails-postgres using a PostgreSQL service and plan:

$ cf create-service SERVICE PLAN rails-postgres
Creating service rails-postgres
OK

Now push the application:

$ cf push APP-NAME --random-route
Using manifest file manifest.yml

Updating app rails-sample
OK

Creating route rails-sample-desiccative-acetylizer.cfapps.io...
OK

Binding rails-sample-desiccative-acetylizer.cfapps.io to rails-sample...
OK

Uploading rails-sample...
Uploading app files from: rails_sample_app
Uploading 41.1M, 6349 files
OK
Binding service rails-postgres to app rails-sample
OK

Starting app rails-sample
OK
...

0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
1 of 1 instances running

App started

Showing health and status for app rails-sample
OK

requested state: started
instances: 1/1
usage: 256M x 1 instances
urls: rails-sample-desiccative-acetylizer.cfapps.io

     state     since                    cpu    memory          disk
#0   running   2014-05-29 03:34:22 PM   0.0%   50.3M of 256M   80.2M of 1G

The application will be pushed using settings in the provided manifest.yml file. The --random-route option adds random words in the host to make sure the URL for the app is unique in the Cloud Foundry environment. The output of the cf push command shows the URL that was assigned. Using the provided URL you can browse to the running application.

riding-rails's People

Contributors

sethbergman avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.