Book Image

Chef Infrastructure Automation Cookbook

By : Matthias Marschall
Book Image

Chef Infrastructure Automation Cookbook

By: Matthias Marschall

Overview of this book

Table of Contents (14 chapters)
Chef Infrastructure Automation Cookbook Second Edition
About the Author
About the Reviewers

Managing Ruby on Rails applications

Ruby on Rails helps you to quickly get your web applications up and running. However, deployment is not an issue solved by the framework. In this section, we'll see how to write the simplest possible recipe to deploy a Rails application, using unicorn as the application server and SQLite as the database.

Getting ready

Make sure that you have a cookbook called my_cookbook and that the run_list of your node includes my_cookbook, as described in the Creating and using cookbooks recipe in Chapter 1, Chef Infrastructure.

Create Berksfile in your Chef repository including my_cookbook:

mma@laptop:~/chef-repo $ subl Berksfile
cookbook 'my_cookbook', path: './cookbooks/my_cookbook'

How to do it...

Let's get our Ruby on Rails application up and running on our node:

  1. Edit your cookbook's metadata.rb file to make it depend on the application_ruby cookbook:

    mma@laptop:~/chef-repo $ subl cookbooks/my_cookbook/metadata.rb
    depends "application_ruby"
  2. Install your cookbook...