GuidesLanguage guides
Ruby
Ferry builds a Ruby app from its Gemfile and starts it with rackup.
Detect. Ferry finds a Gemfile.
1 / 5
A minimal example
Gemfile
Gemfile.lock
config.ru
source "https://rubygems.org"
gem "rack", "~> 3.1"
gem "rackup", "~> 2.2"
gem "puma", "~> 6.4"run ->(env) { [200, { "content-type" => "text/plain" }, ["Hello from Ruby on Ferry\n"]] }ferry up hello-ruby --followWhat Ferry generates
| Step | What Ferry generates |
|---|---|
| Base image | ruby:<version>-slim. The default is 3.3. Ferry uses the major.minor of .ruby-version, or of the ruby line of the Gemfile, if there is one. |
| System packages | build-essential git libpq-dev libyaml-dev pkg-config, plus default-libmysqlclient-dev for mysql2. |
| Install | bundle install |
| Build | Your build command, if you set one. |
| Start | bundle exec rackup -o 0.0.0.0 -p ${PORT:-10000}, when the project has a config.ru. |
Rails
Add a Procfile:
web: bundle exec rails server -b 0.0.0.0 -p $PORTThen use ferry env set for the environment variables that Rails needs in production (RAILS_ENV, SECRET_KEY_BASE…).