page:guides:rails:configuration secrets

Configure environment and secrets for Rails

Summary

Configuration and secrets for a Rails app on Ample. Verified on Rails: an --env value delivered encrypted and reported as present without being echoed (secret=set). Build and start: bundle install into vendor/bundle from Gemfile.lock (development and test groups skipped), then Puma via rails server reading PORT on the ruby-3.4 template with RAILS_ENV=production.

Prerequisites

Workflow Steps

  1. Build and start
    bundle install into vendor/bundle from Gemfile.lock (development and test groups skipped), then Puma via rails server reading PORT on the ruby-3.4 template with RAILS_ENV=production; the server must bind 0.0.0.0 on PORT.

  2. Pass values on deploy
    Use --env KEY=value (repeatable) or --env-file; values are encrypted at rest and reused on redeploys. Declare names only in ample.toml.
    Command: ample deploy . --name --public --env MY_SECRET=...

  3. Verify
    Fetch the live URL and /p/configuration-secrets on the example; on failure read the build and runtime logs.
    Command: ample logs --kind build

Tested Configuration

Costs

Cost Components

Limitations

Success Checks

Evidence Summary

Next Actions