Skip Navigation
Show nav
Dev Center
  • Get Started
  • Documentation
  • Changelog
  • Search
  • Get Started
    • Node.js
    • Ruby on Rails
    • Ruby
    • Python
    • Java
    • PHP
    • Go
    • Scala
    • Clojure
    • .NET
  • Documentation
  • Changelog
  • More
    Additional Resources
    • Home
    • Elements
    • Products
    • Pricing
    • Careers
    • Help
    • Status
    • Events
    • Podcasts
    • Compliance Center
    Heroku Blog

    Heroku Blog

    Find out what's new with Heroku on our blog.

    Visit Blog
  • Log inorSign up
Hide categories

Categories

  • Heroku Architecture
    • Compute (Dynos)
      • Dyno Management
      • Dyno Concepts
      • Dyno Behavior
      • Dyno Reference
      • Dyno Troubleshooting
    • Stacks (operating system images)
    • Networking & DNS
    • Platform Policies
    • Platform Principles
  • Developer Tools
    • Command Line
    • Heroku VS Code Extension
  • Deployment
    • Deploying with Git
    • Deploying with Docker
    • Deployment Integrations
  • Continuous Delivery & Integration (Heroku Flow)
    • Continuous Integration
  • Language Support
    • Node.js
      • Troubleshooting Node.js Apps
      • Working with Node.js
      • Node.js Behavior in Heroku
    • Ruby
      • Rails Support
      • Working with Bundler
      • Working with Ruby
      • Ruby Behavior in Heroku
      • Troubleshooting Ruby Apps
    • Python
      • Working with Python
      • Background Jobs in Python
      • Python Behavior in Heroku
      • Working with Django
    • Java
      • Java Behavior in Heroku
      • Working with Java
      • Working with Maven
      • Working with Spring Boot
      • Troubleshooting Java Apps
    • PHP
      • Working with PHP
      • PHP Behavior in Heroku
    • Go
      • Go Dependency Management
    • Scala
    • Clojure
    • .NET
      • Working with .NET
  • Databases & Data Management
    • Heroku Postgres
      • Postgres Basics
      • Postgres Getting Started
      • Postgres Performance
      • Postgres Data Transfer & Preservation
      • Postgres Availability
      • Postgres Special Topics
      • Migrating to Heroku Postgres
    • Heroku Key-Value Store
    • Apache Kafka on Heroku
    • Other Data Stores
  • AI
    • Working with AI
    • Heroku Inference
      • Inference API
      • Quick Start Guides
      • Inference Essentials
      • AI Models
    • Vector Database
    • Model Context Protocol
  • Monitoring & Metrics
    • Logging
  • App Performance
  • Add-ons
    • All Add-ons
  • Collaboration
  • Security
    • App Security
    • Identities & Authentication
      • Single Sign-on (SSO)
    • Private Spaces
      • Infrastructure Networking
    • Compliance
  • Heroku Enterprise
    • Enterprise Accounts
    • Enterprise Teams
    • Heroku Connect (Salesforce sync)
      • Heroku Connect Administration
      • Heroku Connect Reference
      • Heroku Connect Troubleshooting
  • Patterns & Best Practices
  • Extending Heroku
    • Platform API
    • App Webhooks
    • Heroku Labs
    • Building Add-ons
      • Add-on Development Tasks
      • Add-on APIs
      • Add-on Guidelines & Requirements
    • Building CLI Plugins
    • Developing Buildpacks
    • Dev Center
  • Accounts & Billing
  • Troubleshooting & Support
  • Integrating with Salesforce
  • Language Support
  • Ruby
  • Ruby Behavior in Heroku
  • Ruby Application Behavior on Heroku

Ruby Application Behavior on Heroku

Last updated February 12, 2025

Table of Contents

  • Auto-Detection
  • Config Vars
  • Add-ons
  • Process Types
  • Additional Reading

Heroku fully supports pure Ruby applications, such as headless processes and evented web frameworks like Goliath. This article describes their behavior.

Auto-Detection

When Heroku recognizes a deployed app as a pure Ruby application, we respond with -----> Ruby app detected at deploy time.

$ git push heroku main
-----> Ruby app detected

Config Vars

We set the following environment variables on Ruby apps, depending on if you use Cloud Native Buildpacks or not:

Classic Ruby Buildpack Config Vars

  • GEM_PATH => vendor/bundle/#{RUBY_ENGINE}/#{RUBY_ABI_VERSION}
  • LANG => en-us
  • PATH => bin:vendor/bundle/#{RUBY_ENGINE}/#{RUBY_ABI_VERSION}/bin:/usr/local/bin:/usr/bin:/bin
  • DISABLE_SPRING => 1

GEM_PATH is set to the Bundler gem vendor directory.

Ruby Cloud Native Buildpack Config Vars

We set defaults for the following environment variables:

  • JRUBY_OPTS="-Xcompile.invokedynamic=false" - Invoke dynamic is a feature of the JVM intended to enhance support for dynamically typed languages, such as Ruby. This setting caused issues with Physion Passenger 4.0.16 and was disabled details. You can override this value.
  • RACK_ENV=${RACK_ENV:-"production"} - An environment variable that can affect Rack-based web servers and web apps behavior. You can override this value.
  • RAILS_ENV=${RAILS_ENV:-"production"} - A value used by all Rails apps. By default, Rails ships with three environments: development, test, and production. We recommend that all apps being deployed use production and against using a custom env such as staging details. You can override this value.
  • SECRET_KEY_BASE=${SECRET_KEY_BASE:-<generate a secret key>} - In Rails, 4.1+ apps, a value for generating cryptographic tokens for various things. Notably, this value is used in generating user sessions, so modifying it between builds has the effect of logging out all users. This buildpack provides a default generated value. You can override this value.
  • BUNDLE_WITHOUT=development:test - Tells Bundler not to install development or test groups during bundle install. You can override this value.

Environment variables modified - In addition to the default list, the buildpack modifies these environment variables:

  • BUNDLE_BIN=<bundle-path-dir>/bin - Install executables for all gems into the specified path.
  • BUNDLE_CLEAN=1 - After a successful bundle install, the Bundler automatically runs bundle clean to remove all stale gems from previous builds that are no longer specified in the Gemfile.lock.
  • BUNDLE_DEPLOYMENT=1 - Requires Gemfile.lock to be in sync with the current Gemfile.
  • BUNDLE_GEMFILE=<app-dir>/Gemfile - Tells Bundler where to find the Gemfile.
  • BUNDLE_PATH=<bundle-path-dir> - Directs Bundler to install gems to this path
  • DISABLE_SPRING= "1" - Spring is a library that tries to cache application state by forking and manipulating processes with the goal of decreasing development boot time. Disabling it in production removes significant problems. See details.
  • GEM_PATH=<bundle-path-dir> - Tells Ruby where gems are.
  • MALLOC_ARENA_MAX=2 - Controls glibc memory allocation behavior with the goal of decreasing overall memory allocated by Ruby. See details.
  • PATH - Various executables are installed and the PATH env var will be modified so they can be executed at the system level. This is mostly done via interfaces provided by libcnb and CNB layers rather than directly.
  • RAILS_LOG_TO_STDOUT=" enabled" - Sets the default logging target to STDOUT for Rails 5+ apps. details
  • RAILS_SERVE_STATIC_FILES=" enabled" - Enables the ActionDispatch::Static middleware for Rails 5+ apps so that the Ruby webserver, such as Puma, serves static files such as the ones in public/assets. See details.

Add-ons

If you created your account before May 15, 2023 or if you asked Heroku Support to enable Heroku Postgres auto-provisioning for your account, see Ruby Database Auto-Provisioning.

Process Types

No default web process type is created if a pure Ruby application is detected.

Additional Reading

  • Heroku Ruby Support
  • Specifying a Ruby Version
  • Rack Application Behavior on Heroku
  • Rails Application Behavior on Heroku
  • Working with Ruby category

Keep reading

  • Ruby Behavior in Heroku

Feedback

Log in to submit feedback.

Ruby Default Web Server Ruby Application Restart Behavior

Information & Support

  • Getting Started
  • Documentation
  • Changelog
  • Compliance Center
  • Training & Education
  • Blog
  • Support Channels
  • Status

Language Reference

  • Node.js
  • Ruby
  • Java
  • PHP
  • Python
  • Go
  • Scala
  • Clojure
  • .NET

Other Resources

  • Careers
  • Elements
  • Products
  • Pricing
  • RSS
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku Blog
    • Heroku News Blog
    • Heroku Engineering Blog
  • Twitter
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku
    • Heroku Status
  • Github
  • LinkedIn
  • © 2025 Salesforce, Inc. All rights reserved. Various trademarks held by their respective owners. Salesforce Tower, 415 Mission Street, 3rd Floor, San Francisco, CA 94105, United States
  • heroku.com
  • Legal
  • Terms of Service
  • Privacy Information
  • Responsible Disclosure
  • Trust
  • Contact
  • Cookie Preferences
  • Your Privacy Choices