Skip to content

Getting Rails in the pool

auser edited this page Sep 13, 2010 · 14 revisions

Let’s get a fully-automated, scalable rails web application in the pool.

First, let’s generate the rails app


rails poolparty_app

Keeping my directories together:


cd poolparty_app

Now, build your app… I can wait…

Ready? Now edit the pool.spec to add rails… Sample rails setup:


    pool "poolparty" do
      cloud "chef" do
        instances 1
        using :ec2
        chef :solo do
          repo File.dirname(__FILE__)+"/chef_cloud/chef_repo"
          recipe "apache2"
          recipe "passenger"
          recipe "rails"
          attributes :apache2 => {:listen_ports => ["80", "8080"]}
        end
        security_group do
          authorize :from_port => "22", :to_port => "22"
          authorize :from_port => "80", :to_port => "80"
        end
      end
    end

Note, this is a chef recipe, so check out the chef tutorials here: http://wiki.opscode.com/

For the time being, we won’t worry about the database-side of the app as we’ll get to that in another tutorial.

Now, let’s go into the clouds directory RAILS_ROOT:


cloud start

Now your cloud is starting up. Depending on your setup, this process can take up to 10 minutes

Clone this wiki locally