Help Center

Deploy on Heroku

Written by Miguel Michelson


Heroku is the easiest way to deploy Chaskiq. There are two main modes on which you can deploy the application; the first way is using the Heroku button, this will not require any local installation and will handle all the heavy lifting for you.
The second way is cloning the repo and installing it through the Heroku client. Let's dig into it.

TL;DR, Full tutorial Video:


This tutorial will have you deploying a Ruby app in minutes. Hang on for a few more minutes to learn how it all works so that you can make the most out of Heroku. The tutorial assumes that you have:

Set up

The Heroku CLI requires Git, the popular version control system. If you don't already have Git installed, complete the following before proceeding: Git installation First-time Git setup
In this step, you'll install the Heroku Command Line Interface (CLI). You use the CLI to manage and scale your applications, provision add-ons, view your application logs, and run your application locally.

Prepare the App

To clone the sample application so that you have a local version of the code that you can then deploy to Heroku, execute the following commands in your local command shell or terminal:

$ git clone
$ cd chaskiq

You now have a functioning git repository that contains a simple application as well as a Gemfile file, which is used by Ruby's dependency manager, bundler.

Deploy the app

In this step you will deploy the app to Heroku. Create an app on Heroku, which prepares Heroku to receive your source code.

$ heroku create
Creating app... done, ⬢ polar-inlet-4930 |
Git remote heroku added

When you create an app, a Git remote (called Heroku) is also created and associated with your local git repository. Heroku generates a random name (in this case polar-inlet-4930) for your app, or you can pass a parameter to specify your own app name. Now deploy your code:

$ git push heroku master

Configure Environment

Note that you will need setup some environment variables first in order to work properly, (this is not required if you install it through the Heroku button) please refer to the Heroku env vars management the required env vars:



Important things are your HOST and WS vars and ADMIN_EMAIL and ADMIN_PASSWORD for initial admin generation and the AWS credentials

Now that you have successfully installed the app, run these commands:

heroku run rails db:migrate
heroku run rails db:seed

Create New Admin

The rails admin_generator task will create an admin user for you, you will need to have an ADMIN_EMAIL and ADMIN_PASSWORD on your .env try these credentials:

heroku run rails admin_generator

The application is now deployed, and data migrated. Now visit the app at the URL generated by its app name. As a handy shortcut, you can open the website as follows:

$ heroku open

Deploy Worker:

To process the heavy tasks is essential to add a second instance to your dyno formation, so add this command to your dyno formation:

bundle exec sidekiq -C config/sidekiq.yml

And that's it. Happy Chatting!