Rails 8 generator

Start a Rails app with your choices already made.

Pick the database, tests, frontend, jobs, auth, CI and deployment. opinionated_rails builds the app and checks that it boots and passes its own lint and security scans.

$gem install opinionated_rails

What you get

◧

Composable options

Database, tests, Stimulus or React, Solid or Redis, Rails 8 auth or Devise, and more. Each is independent.

↻

Repeatable runs

Every prompt has a flag and a config file key. Values are validated before anything is generated.

✓

Checked, not just generated

The app boots in development, production and staging, and passes RuboCop, Brakeman and bundler-audit.

↗

Deployment included

A complete Kamal config for your stack and a GitHub Actions workflow with the right services.

⚠

Fails loudly

If a Rails release changes text a step edits, you get the exact line to add, not a half-configured app.

▦

Tested as real apps

A matrix generates a real app for every supported combination and runs its own checks.

How it works

  1. ChooseAnswer the prompts, pass flags, or point it at a YAML file.
  2. GenerateIt runs rails new, then each step adds its gems and files in dependency order.
  3. FinishFinal installs, JavaScript and CSS builds, and a safe RuboCop autocorrect.
  4. ShipReview the few placeholders, then deploy with Kamal.

Try it

opinionated_rails new shop
# interactive: every prompt shows its default (excerpt)
$ opinionated_rails new shop
Choose a database:
  1. SQLite
  2. PostgreSQL
  3. MySQL
Database (default: SQLite): postgresql
Choose an app type:
  1. Full-stack
  2. API-only
App type (default: Full-stack):
Choose a test framework:
  1. Minitest
  2. RSpec
Test framework (default: Minitest): rspec

Or skip every question:

opinionated_rails new shop --database postgresql --javascript esbuild --yes
opinionated_rails new shop --config answers.yml --yes

A mistake fails immediately, before anything is generated:

Invalid value "oracle" for `database`. Choose one of: sqlite, postgresql, mysql

What it supports

Area Supported
Rails 8.1 or newer in the 8.x series (other versions are rejected up front)
Ruby 3.2, 3.3, 3.4
Database SQLite, PostgreSQL, MySQL
App type Full-stack, API-only
Tests Minitest, RSpec (with FactoryBot or fixtures)
Frontend Stimulus + Hotwire, or React with esbuild, bun or webpack
Jobs, cache, cable Solid Trifecta, or Redis + Sidekiq
Authentication None, Rails 8 built-in, Devise (full-stack apps only)

Each combination is exercised by a real-app test matrix: every file in spec/fixtures/combos/ generates a real app that must pass the health checks.

Rollup is not offered, because Rails’ rollup setup cannot build the JSX the React option writes.

Where to go next


Back to top

Released under the MIT License.