Skill Tracer
Skills › Compound Engineering › ce-polish › dev-server-rails.md

dev-server-rails.md

50 lines · skills/ce-polish/references/dev-server-rails.md at 3449230

Open on GitHub

Most marks come from matching words in the file, so treat them as pointers.

1# Rails dev-server recipe (auto-detect fallback)
2
3Loaded when `detect-project-type.sh` returns `rails` and the startup tuple still lacks a command.
4

Rails dev-server recipe (auto-detect fallback)

Loaded when detect-project-type.sh returns rails and the startup tuple still lacks a command.

Raw lines 1 to 4
5## Signature
6
7- `bin/dev` exists and is executable
8- `Gemfile` exists
9

Signature

  • bin/dev exists and is executable
  • Gemfile exists
Raw lines 5 to 9
Runs code bin/dev :7
10## Start command
12```bash
13bin/dev
14```
16`bin/dev` is the Rails 7+ convention for "start everything" (web + assets watcher + optional workers). It is a one-liner script that invokes `foreman start -f Procfile.dev` under the hood, so `Procfile.dev` is the canonical place to read the *actual* command if `bin/dev` is missing or non-executable.

Start command

bin/dev

bin/dev is the Rails 7+ convention for "start everything" (web + assets watcher + optional workers). It is a one-liner script that invokes foreman start -f Procfile.dev under the hood, so Procfile.dev is the canonical place to read the actual command if bin/dev is missing or non-executable.

Raw lines 10 to 17
Runs code bin/dev :13
18## Port
20Default: `3000`. Overrides follow the cascade in `references/dev-server-detection.md`:
211. `Procfile.dev` `web:` line may contain `-p <n>`
222. `config/puma.rb` may bind to a non-default port
233. `.env` / `.env.development` `PORT=<n>`
244. a dev-server port explicitly stated in the project's active instructions in context (not grepped from instruction files)

Port

Default: 3000. Overrides follow the cascade in references/dev-server-detection.md:

  1. Procfile.dev web: line may contain -p <n>
  2. config/puma.rb may bind to a non-default port
  3. .env / .env.development PORT=<n>
  4. a dev-server port explicitly stated in the project's active instructions in context (not grepped from instruction files)
Raw lines 18 to 25
26## Stub generation for `.claude/launch.json`
28When the user accepts "Save this as `.claude/launch.json`?", emit the Rails stub from `launch-json-schema.md`:
30```json
32 "version": "0.2.0",
33 "configurations": [
34 {
35 "name": "Rails dev",
36 "runtimeExecutable": "bin/dev",
37 "runtimeArgs": [],
38 "port": 3000
39 }
40 ]
42```
44If the cascade resolved a non-3000 port, substitute it in the stub's `port` field before writing.

Stub generation for .claude/launch.json

When the user accepts "Save this as .claude/launch.json?", emit the Rails stub from launch-json-schema.md:

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Rails dev",
      "runtimeExecutable": "bin/dev",
      "runtimeArgs": [],
      "port": 3000
    }
  ]
}

If the cascade resolved a non-3000 port, substitute it in the stub's port field before writing.

Raw lines 26 to 45
Runs code bin/dev :36
46## Common gotchas
48- **Bundler path:** some machines require `bundle exec bin/dev`. If `bin/dev` fails with a load-path error, fall back to `bundle exec bin/dev`.
49- **Foreman vs overmind:** `Procfile` vs `Procfile.dev` often both exist. Rails' `bin/dev` resolves to `Procfile.dev`; if the project uses `overmind` explicitly, prefer `overmind start -f Procfile.dev` (see `dev-server-procfile.md`).
50- **SSL dev server:** `rails s --ssl` serves over `https://`. Treat server output or a user correction as evidence that replaces the default HTTP candidate, then verify that HTTPS URL against the selected instance before handoff. The launch configuration needs no URL field; an explicit `port` still helps identify the intended endpoint without locking its scheme.

Common gotchas

  • Bundler path: some machines require bundle exec bin/dev. If bin/dev fails with a load-path error, fall back to bundle exec bin/dev.
  • Foreman vs overmind: Procfile vs Procfile.dev often both exist. Rails' bin/dev resolves to Procfile.dev; if the project uses overmind explicitly, prefer overmind start -f Procfile.dev (see dev-server-procfile.md).
  • SSL dev server: rails s --ssl serves over https://. Treat server output or a user correction as evidence that replaces the default HTTP candidate, then verify that HTTPS URL against the selected instance before handoff. The launch configuration needs no URL field; an explicit port still helps identify the intended endpoint without locking its scheme.
Raw lines 46 to 50
Runs code bin/dev :48