Adding Postgres and ActiveRecord
Getting started - adding dependencies to your project
A Procfile tells Heroku how to startup your application on it’s servers.
A Procfile is a mechanism for declaring what commands are run by your application’s dynos (or a web process) on the Heroku platform. You can use a Procfile to declare various process types, such as
A Procfile is a file named
Procfile. It should be named
Procfile exactly, and not anything else. For example, Procfile.txt is not going to work. The file should be a simple text file.
The file must be placed in the root directory of your application. It will not function if placed in a subdirectory.
Using your favorite text editor open the project folder and add a new file called ‘Procfile’ (a text file) in the root directory of your application. We’ll use this to explicitly declare what command should be executed to start your app on Heroku
Open this file and edit the contents to read
web: bundle exec ruby app.rb -p $PORT
Tip If your main code file isn’t named app.rb change it accordingly!
This declares a single process type, web, and the command needed to run it. The name web is important here. It declares that this process type will be attached to the HTTP routing stack of Heroku, and receive web traffic when deployed. The command used here is to run the web server.
Procfiles can contain additional process types. For example, you might declare one for a background worker process that processes items off of a queue.
Don’t forget to commit your changes
Full credit: Much of this is adapted from the Heroku guide, but set up to show you how to transition a local project into a heroku deployable project.