Heroku offers a platform as a service which is commonly used by Ruby on Rails developers to host their projects. Although more expensive then just renting out servers, this expense is offset by time saved not worrying about developer operations such as server security, availability, monitoring, scaling etc.
Would you like to get started right away and deploy a sample application? Deploy to Heroku now!
Otherwise if you'd like to deploy an app that you've created carry on reading...
Deploying Integral with Heroku
Deploying Integral using Heroku is just like deploying any other Ruby on Rails application. If you're new to Heroku it's worth checking out their article getting start with Rails.
This guide assumes the following;
- You have successfully setup Integral and can access it locally
- Your applications database is using Postgres
- Your project is stored in Git
- You have an active account with Heroku
- You have the Heroku CLI installed
- You have followed the essential production setup steps
The step by step
- Create a Procfile at the root of your project - This tells Heroku how to run the application.
web: bundle exec puma -C config/puma.rb
No need to create the config file - Rails 5 automatically generates this when creating a new project.
- Create a blank Heroku app
heroku create example_app
- Within your project directory, link the Heroku app you just created to Git.
heroku git:remote -a example_app
- Push your project up to the new Heroku app - Make sure you have first checked everything into git.
git push heroku master
- Thats it! Check the Heroku Project URL to view your application. For this example the URL would be;
It will take a few minute to deploy, if it doesn't appear or it looks like there has been an issue go to your Heroku dashboard and see if there was a problem deploying the application.
Things you'll want to do next (post deploy)
- Add the image optimizer buildpack to your Heroku app so that your application can compress and resize images
heroku buildpacks:add --index 2 https://github.com/yamasolutions/image-optimizers-buildpack
- Heroku Pipelines - Never has it been easier to test your project in production. Setup a Heroku pipeline, link it to Github and enable review apps for every project.
- Create a staging app within the Heroku pipeline - Very useful for testing features before they hit live.
- Install addons (see below)
- Plus other non Heroku related things...
Troubleshooting & things that may go wrong
- Make sure to push app directly to heroku through command line rather than manual deploy through web app. This means it will create all the required environment variables.
- You may need to turn on dynos through the Heroku UI
- Review apps - Base your review app off your staging app rather than your production app - Don't want to override production data!
- Review apps - Make sure you post deploy script is executable
chmod a+x post-deploy.sh
- Missing environment variables, did you forget to setup AWS S3 for image uploads?