Preparing for Heroku

You’ll need to prepare your Rails application for deployment to Heroku.
Gemfile

We need to modify the Gemfile for Heroku.

We add a group :production block for gems that Heroku needs:

    pg – PostgreSQL gem
    thin – web server
    rails_12factor – logging and static assets

Heroku doesn’t support the SQLite database; the company provides a
PostgreSQL database. Though we won’t need it for our tutorial
application, we must include the PostgreSQL gem for Heroku. We’ll mark
the sqlite3 gem to be used in development only.

The Thin web server is easy to use and requires no configuration. Note
that Heroku recommends Unicorn for handling higher levels of traffic
efficiently. Unicorn can be difficult to setup and configure, so we’re
using Thin for our tutorial application.

On Heroku, Rails needs an extra gem to handle logging and serve CSS and
JavaScript assets. The rails_12factor gem provides these services.