nnesly

Deploy Ruby on Rails

How nesly detects, builds and serves a Ruby on Rails project — and the two commands that put it on a live URL.

Deploy Ruby on Rails on nesly

A Ruby on Rails project is built into a container and run as a server process.

cd your-project
nesly addon add postgres
nesly deploy --yes

The first deploy creates the project and prints the live URL; after that,nesly deploy is enough.

How detection sees it

  • A Rails tree (config/application.rb + Gemfile) runs as a container.
  • The first deploy mints SECRET_KEY_BASE and stores it on the project — the same value on every later deploy.
  • RAILS_SERVE_STATIC_FILES and RAILS_LOG_TO_STDOUT are set to true so production.rb serves public/ assets and logs reach nesly logs (override either yourself to turn them off).

When detection is not what you want, say it yourself: build and start commands, root directory and output directory live in nesly.tomlcommitted next to the code — see builds.

Worth knowing

  • Listen on the PORT environment variable; bind 0.0.0.0.
  • Schema changes belong in nesly.toml: release = "bundle exec rails db:migrate".
  • Attach a managed database withnesly addon add postgres (ormssql) — connection env vars are injected on the next deploy.
  • When a deploy fails, nesly diagnosereads the logs for you and names the fix.

Full walkthrough: get started. Custom domains, backups, GitHub deploys and the rest of the reference: nesly CLI.