Search overlay panel for performing site-wide searches

Salesforce (Heroku) Recognized as a Leader. Learn More!

A stylized pink diamond shape with a circular top and faceted sides.

Build Rails web apps and Ruby back-ends on the leading PaaS

Cloud application hosting for Ruby and Rails

Leader in Ruby on PaaS

Heroku pioneered Ruby on a PaaS and we continue to innovate the developer experience with Ruby deployment pipelines for continuous delivery from GitHub and Docker support for dev/prod parity. Ruby developers get same-day Ruby release support for MRI and can run Ruby on the JVM with JRuby support. Heroku makes deploying and managing your Rails apps easy. We are dedicated to supporting the Ruby community and employ four Ruby-language core team members, including Matz, the creator of Ruby.

Optimized build and migration workflow

Heroku caches assets between deploys for faster builds. Use one-off dynos to run rake:db migrate for database migration operations, or attach a Rails console to easily inspect and debug live apps. Preboot lets you deploy a new release to your web dynos and have them receive traffic before terminating existing ones, which can contribute to zero downtime deployments.

 Runtime and framework support

Run web apps using Rails, Sinatra and Rack. Coordinate Ruby backend workers using your choice of queuing system, including Sidekiq. Handle concurrent web requests using a single dyno and mitigate slow clients with Puma. Heroku Postgres is a database as a service optimized for developers, with JSONB support for fast semi-structured data access.

Get started now with Ruby on Heroku

Deploying Ruby apps with Heroku

  • Initialize the local Git repository
  • bundle init initializes the Ruby project
  • Specify the Ruby version and add dependencies
  • Create a config.ru file to respond to requests with “Hello Heroku!”
  • Create and deploy the app to Heroku
  • We’re live! curl https://quiet-bastion-45713-b6f03f913354.herokuapp.com

View Ruby Docs

Heroku gives you simple, easy ways to…

Deploy

Deploy from Git, your CI system, or on every push to a branch in GitHub. Heroku runs your app in a dyno — a smart, secure, curated container with your choice of Ruby version and interpreter. Dynos come in different types, ranging from low-cost dynos for experimentation and prototyping to dedicated types for your highest-traffic apps.

Heroku’s Ruby Support Docs

Manage

Manage your app portfolio in a straightforward dashboard or with a CLI. Extend your apps with more than 200 fully managed add-ons for a range of functionality such as data stores, logging, and more. Provisioning an add-on is as simple as heroku addons:create papertrail. You can just as easily add Heroku Postgres.

Heroku’s Add-ons Docs

Scale

Heroku’s horizontally scalable, share-nothing architecture is designed for building services in today’s world of containerized applications. Use App Metrics to monitor CPU, throughput, and memory so you know when to scale. Scale out your Ruby app’s web dynos with a single CLI command or by dragging a slider in the Heroku Dashboard.

How to scale dynos

A red gemstone icon with a glossy finish and multiple facets.

Ruby on Heroku

“Ruby gave us developer happiness and Rails gave us convention over configuration. Heroku gives you a first class experience while deploying and running your Ruby apps.”

A person with a beard and short brown hair smiles at the camera. The background features a blurred swirl pattern.

Richard Schnmeeman

Ruby Language Owner

Popular Add-ons

Add-ons are fully-managed services, integrated for use with Heroku, which provide services for logging, caching, monitoring, persistence and more. View All Add-ons

Heroku Postgres

Data Stores

A geometric design with interlocking green and dark gray rectangular shapes forming a 3D-like structure on a white background.

New Relic APM

Monitoring

Redis logo with the name in white cursive text on an orange-red background.

Redis Cloud

Data Stores

Papertrail logo

Papertrail

Logging

Blue logo with a stylized lowercase "d" beside a small dot on the lower right.

Librato

Monitoring

Heroku Ruby Support FAQ

Heroku manages Ruby dependencies using Bundler, the standard package manager for the Ruby ecosystem. When you deploy a Ruby application, the Heroku buildpack detects your Gemfile and Gemfile.lock files. It then runs the bundle install command, which uses your Gemfile.lock to install the exact versions of every gem your project needs, ensuring that the production environment on Heroku is a perfect match for your local development environment.

The fastest way to get started is by following the official Getting Started on Heroku with Ruby guide in the Heroku Dev Center. This tutorial provides a sample application and walks you through the steps of cloning the repository, provisioning a Heroku app, and deploying your code with a simple git push heroku main command.

Once you’re done with that, we recommend you learn how to build a Rails 8 app from scratch and deploy it to Heroku.

Heroku’s Ruby support aligns with the official Ruby Core support policy, providing support for all modern, stable versions (including Ruby 3.3 and 3.4). You can specify the exact Ruby version your application requires in your Gemfile.

Heroku highly recommends specifying a Ruby version and not relying on the default, as the default can change over time. For best performance and security, it is recommended to run the latest patch release of a supported Ruby version and to upgrade before a version reaches its official End-of-Life (EOL). For a complete list of currently supported and unsupported Ruby versions, please see the official documentation in the Heroku Dev Center.

The most popular framework on Heroku, and in the broader Ruby ecosystem, is Ruby on Rails. For developers building smaller applications or APIs, lightweight microframeworks like Sinatra and Hanami are also an excellent and popular choice. Because Heroku’s support for Ruby is deep and long-standing, the platform can accommodate almost any Ruby-based web framework.

Heroku is designed to work seamlessly with the Rails Asset Pipeline. Assets can be compiled locally or automatically during deployment (the default and also Heroku’s recommended approach). When you deploy a Rails application, the buildpack runs the rake assets:precompile task to compile and compress your assets (like CSS and JavaScript) for production.

For the best user experience, Heroku recommends pairing the asset pipeline with a Content Delivery Network (CDN). This speeds up asset delivery to your users and reduces the load on your Heroku app.

Note: If you want to skip asset compilation on Heroku, you can precompile locally and check in a .manifest.json or similar manifest file is detected in your app, Heroku will assume you are handling asset compilation yourself and will not attempt to compile your assets.

Yes. This is a common and powerful feature of the Heroku platform, handled by the Heroku CLI. Using the heroku run command, you can start a new instance of your application’s environment (called a one-off dyno) to execute commands. For example, you can open an interactive Rails console with heroku run rails console or run a database migration with heroku run rails db:migrate. This is extremely useful for debugging, running administrative tasks, and managing your database schema.

You can also get a plain interactive shell by running heroku run bash that will allow you to inspect the contents of your application using common terminal commands such as cat and ls -la.

For modern Ruby applications, especially those built with Ruby on Rails, the recommended and most commonly used web server on Heroku is Puma. Puma is a fast and highly concurrent web server that is the default for Rails. It is well-suited for Heroku’s dyno architecture, allowing your application to efficiently handle multiple requests at once. Your application’s Procfile will typically define a web process to start the Puma server.

You can run background jobs with tools like Sidekiq or Resque by declaring a new process type in your Procfile. While a web process handles HTTP requests, you can define a worker process to handle your background jobs. The Procfile entry would contain the command to start the Sidekiq process.

Background job systems like Sidekiq require a queuing backend, and the standard choice on Heroku is Heroku Key-Value Store, which can be attached as an add-on. Once you’ve defined your worker process and configured your Key-Value Store add-on, you can then scale your worker dynos independently from your web dynos to process your jobs with the heroku ps:scale worker=<count>:<dyno-type> command

No. Heroku applications use an ephemeral disk that does not persist between application restarts and SQLite relies on local disk writes to persist data. Instead, Heroku recommends using PostgreSQL. Read more about the differences between PostgreSQL and SQLite.

While not directly supported, it is possible (though not recommended for a production-grade system) to use a streaming replication system for sqlite that would allow you to back up the database to a data store such as S3 between restarts. You will also need to use a buildpack such as the Aptfile buildpack to install sqlite and libsqlite3-dev packages, which are required to build a native library that binds with sqlite. This will limit your ability to scale horizontally, and downloading a database copy on application boot will degrade your performance over time.

Ready to Get Started?

Stay focused on building great data-driven applications and let Heroku tackle the rest.

Sign Up Now