A Ruby app deploys from its repository. Nimbus Land recognises it from your Gemfile, builds it and starts it, and for Rails fills in the settings a first deploy needs. Your own values always win.
Quick start#
A stock rails new app deploys as is. In the console, create an app from your repository with the deploy wizard. From the CLI, run this in the project directory:
nimbus deploy
Check these first:
- Your server listens on
PORT. Puma and Rails already do. See what every app needs. - If the app reads encrypted credentials, have your
config/master.keyready to paste asRAILS_MASTER_KEY. See Rails. - If the app uses SQLite, keep the storage volume the wizard offers, or every release starts with an empty database.
For non-Rails Ruby apps, RACK_ENV=production is suggested.
Rails#
A stock rails new app ships its own Dockerfile, and Nimbus Land builds from it. See Dockerfile. A Rails app without a Dockerfile is built by Nimbus Land directly. Either way, it fills in what a first deploy needs:
RAILS_ENVandRACK_ENVare set toproductionwhen your image doesn't set them.SECRET_KEY_BASEis generated and stored on the app when neither it norRAILS_MASTER_KEYis set, so a stock app boots and sessions survive redeploys.RAILS_MASTER_KEYappears in the wizard as an empty secret. Paste your localconfig/master.keyonly if the app reads encrypted credentials. It is required when the repository shipsconfig/credentials.yml.enc(orconfig/credentials/production.yml.enc) andconfig/environments/production.rbsetsconfig.require_master_key = true; the wizard then holds Deploy until it is filled. From the CLI:nimbus env set RAILS_MASTER_KEY=- --secret < config/master.keyStorage volume. A SQLite app keeps its databases under
storage/. When theGemfilenamessqlite3and neitherpgnormysql2, the wizard offers a 1 GB volume at/rails/storage(/workspace/src/storagewhen Nimbus Land builds the app itself). Keep it, or every release starts with an empty database. From the CLI or API, attach a volume at the same path yourself. An app with a volume stops the old instance before starting the new one, so a redeploy has a few seconds with nothing serving. See Volumes and SQLite databases.Background jobs. When the
Gemfilenamessolid_queue,SOLID_QUEUE_IN_PUMA=trueis suggested so queued jobs run. Alternatively, add the Solid Queue worker in the Background workers section of the Resources tab. See commands, workers and one-off runs.Migrations. The scaffold's entrypoint runs
bin/rails db:prepareon every start. With Postgres, use the release command instead: the wizard suggestsbundle exec rails db:migrate. See release command.
Troubleshooting#
For problems that aren't specific to Ruby, such as an app that never answers, see Apps troubleshooting.
Missing master key#
The app fails at start with Missing encryption key to decrypt file with. Add RAILS_MASTER_KEY as a secret on the Resources tab (the contents of config/master.key, or config/credentials/production.key) and deploy again.
ArgumentError: unknown keyword: quirks_mode#
A fresh Rails 8.0 app fails assets:precompile with this message. Add gem "json", "< 3" to the Gemfile, run bundle install, commit and deploy again.
The SQLite database is empty after a deploy#
The app has no volume at its storage/ path. Attach one as described under Rails.
Also available as Markdown.