Deploy

Deploy application to Heroku

Ruby on Rails is a popular framework. I deploy the app on the Heroku. Following are the steps to deploy the app:

Step 1: Install the Heroku Toolbelt on your local workstation. For Ubuntu/Debian we use the following command:

    wget -O- https://toolbelt.heroku.com/install-ubuntu.sh | sh

Step 2: Open your terminal and run $ heroku login

Step 3: To run on Heroku your app must be configured to use the Postgres database,have the rails_12factor gem in the production group of your Gemfile

    gem 'rails_12factor', group: :production

and run the $ bundle install command.

Step 4: Specify the ruby version in the your Gemfile.

Step 5: Store your app in the git. Make sure you are in your Rails app directory. And commit the all changes by using the following command:

    $ git init

    $ git add .

    $ git commit -m "init"

    $ git status

Step 6: Create an app on Heroku:

    $ heroku create

Step 7: Deploy your code:

    $ git push heroku master

To push a branch other than master, use this syntax:

    $ git push heroku yourbranch:master

Step 8: Migrate your database:

    $ heroku run rake db:migrate

Step 9: Visit your application:

Let’s ensure we have one dyno running the web process type:

    $ heroku ps:scale web=1

Lists the running dynos of your application:

    $ heroku ps

Visit your application:

    $ heroku open
Written on July 30, 2016