Book Image

Heroku Cookbook

By : Mike Coutermarsh
Book Image

Heroku Cookbook

By: Mike Coutermarsh

Overview of this book

Heroku is a Platform as a Service that enables developers to rapidly deploy and scale their web applications. Heroku is designed for developer happiness, freeing developers from doing system administrative tasks such as configuring servers and setting up load balancers. Developers are able to focus on what they do best, building web applications, while leaving the details of deployment and scaling to the experts at Heroku. This practical guide is packed with step-by-step solutions to problems faced by every production-level web application hosted on Heroku. You'll quickly get comfortable with managing your Heroku applications from the command line and then learn everything you need to know to deploy and administer production-level web applications.
Table of Contents (17 chapters)
Heroku Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Getting started with the Platform API gem


Heroku has created a Ruby gem that makes it easy for us to take full advantage of the Platform API from Ruby. In this recipe, we'll learn how to get up and running with the gem and on our way to integrating the Heroku API with our own Ruby applications. We'll also be introduced to Pry, a super-powerful Ruby shell to execute and explore code. It will help us get up to speed and learn the Heroku API gem quickly.

Getting ready

To start, let's download some sample code to get familiar with the Platform API gem.

  1. Let's open up a terminal and use Git to clone the sample code:

    $ git clone https://github.com/mscoutermarsh/heroku-api-examples.git
    $ cd heroku-api-examples
    
  2. We'll need Ruby 2.1.2 to run these examples. If we have RVM installed, we can select 2.1.2:

    $ rvm use 2.1.2
    

    Note

    If it isn't installed, RVM will give us instructions on how to install it.

  3. Now, let's install the dependencies by running bundler:

    $ bundle install
    

How to do it…

We now have everything...