Rack Application Behavior on Heroku
Last updated September 17, 2024
This article is a work in progress, or documents a feature that is not yet released to all users. This article is unlisted. Only those with the link can access it.
Table of Contents
Rack applications behave like Ruby applications with the following additions.
Auto-Detection
A root-level config.ru
file specifies the existence of a Rack application. When Heroku recognizes a deployed app as a Rack application, we respond with -----> Ruby/Rack app detected
at deploy time.
$ git push heroku main
-----> Ruby/Rack app detected
Config Vars
We set the following environment variables, in addition to the ones we set for Ruby Application Behavior on all Ruby apps.
RACK_ENV
=> “production”
Add-ons
Adds the same add-ons as a pure Ruby app.
Process Types
If you don’t include a Procfile
, Rack apps define a web process type at deploy time:
web: bundle exec rackup config.ru -p $PORT
On Heroku, we recommend Puma as the webserver. Regardless of the webserver you choose, always specify the webserver explicitly in the Procfile
on production apps.
As a special case to assist in migration from Bamboo, Ruby apps that bundle the thin
gem get this web process type:
web: bundle exec thin start -R config.ru -e $RACK_ENV -p $PORT