DocktorRails
DocktorRails is a tiny preflight checker for Rails Docker/Compose dev environments. It catches common cross-machine issues early (CRLF shell scripts, missing compose-referenced files, build path mistakes, platform pinning risk) and provides CI-friendly JSON output.
Installation
Add it to your Rails app:
bundle add docktor_rails
Usage
Run in your project root:
bundle exec docktor_rails diagnose
Scan another directory (useful in mono-repos):
bundle exec docktor_rails diagnose --root ../some_app
CI/automation (JSON):
bundle exec docktor_rails diagnose --format json --output preflight.json
Options:
--verbose: show passing checks--quiet: only show errors/warnings + summary (good for CI logs)
Exit codes
0: no failing checks1: one or more failing checks2: tool/internal error
GitHub Actions example
name: Preflight
on:
pull_request:
push:
branches: [ main ]
jobs:
preflight:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
bundler-cache: true
- run: bundle exec docktor_rails diagnose --format json --output preflight.json
- if: always()
uses: actions/upload-artifact@v4
with:
name: docktor-rails-preflight
path: preflight.json
Contributing
Issues and pull requests are welcome.
License
MIT