dev-server-rails.md
50 lines · skills/ce-polish/references/dev-server-rails.md at 3449230
Most marks come from matching words in the file, so treat them as pointers.
Rails dev-server recipe (auto-detect fallback)
Loaded when detect-project-type.sh returns rails and the startup tuple still lacks a command.
Start command
bin/devbin/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.
Port
Default: 3000. Overrides follow the cascade in references/dev-server-detection.md:
Procfile.devweb:line may contain-p <n>config/puma.rbmay bind to a non-default port.env/.env.developmentPORT=<n>- a dev-server port explicitly stated in the project's active instructions in context (not grepped from instruction files)
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.
Common gotchas
- Bundler path: some machines require
bundle exec bin/dev. Ifbin/devfails with a load-path error, fall back tobundle exec bin/dev. - Foreman vs overmind:
ProcfilevsProcfile.devoften both exist. Rails'bin/devresolves toProcfile.dev; if the project usesovermindexplicitly, preferovermind start -f Procfile.dev(seedev-server-procfile.md). - SSL dev server:
rails s --sslserves overhttps://. 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 explicitportstill helps identify the intended endpoint without locking its scheme.