Ruby
Railpack builds and deploys Ruby applications with support for several language-specific tools and frameworks.
Detection
Section titled “Detection”Your project is detected as a Ruby application if a Gemfile is present in
the root directory.
Versions
Section titled “Versions”The Ruby version is determined in the following order:
- Set via the
RAILPACK_RUBY_VERSIONenvironment variable - Read from the
.ruby-versionfile - Read from the
Gemfilefile - Read from mise-compatible version files (
.tool-versions,mise.toml) - Defaults to
3.4.6
Runtime Variables
Section titled “Runtime Variables”These variables are available at runtime:
BUNDLE_GEMFILE="/app/Gemfile"GEM_PATH="/usr/local/bundle"GEM_HOME= "/usr/local/bundle"MALLOC_ARENA_MAX="2"Configuration
Section titled “Configuration”Railpack builds your Ruby application based on your project structure. The build process:
- Installs Ruby and required system dependencies
- Installs project dependencies
- Configures the Ruby environment for production
The start command is determined by:
- Framework-specific start command (see below)
config/environment.rbfileconfig.rufileRakefilefile
Config Variables
Section titled “Config Variables”| Variable | Description | Example |
|---|---|---|
RAILPACK_RUBY_VERSION | Override the Ruby version | 3.4.2 |
Framework Support
Section titled “Framework Support”Railpack detects and configures caches and commands for popular frameworks:
Railpack detects Rails projects by:
- Presence of
config/application.rb
Databases
Section titled “Databases”Railpack automatically installs system dependencies for common databases:
- PostgreSQL: Installs
libpq-dev - MySQL: Installs
default-libmysqlclient-dev - Magick: Installs
imagemagick - Vips: Installs
libvips-dev - Charlock Holmes: Installs
libicu-dev