fix: DAH-0000 enable local dev on Windows - #883
Open
fwextensions wants to merge 2 commits into
Open
Conversation
- Invoke shakapacker-dev-server via 'ruby' explicitly in package.json since Windows cmd.exe can't execute Ruby shebang scripts directly. - Add tzinfo-data gem for Windows platforms (no system zoneinfo database on Windows). - Override dev_server.static.publicPath in shakapacker.yml: shakapacker's webpackDevServerConfig.js assigns an absolute filesystem path to static.publicPath, which breaks path-to-regexp on Windows due to backslashes. - Fix database.yml pool sizing to treat PUMA_WORKERS=0 (single mode, used on Windows since clustered/forked workers aren't supported) as 1 process instead of 0. - Document PUMA_WORKERS=0 Windows workaround in .env.sample.
Contributor
There was a problem hiding this comment.
Pull request overview
Enables local development on Windows by adjusting startup scripts and development configuration to account for Windows execution and path semantics, while aiming to keep behavior unchanged on macOS/Linux.
Changes:
- Run
bin/shakapacker-dev-serverviarubyinpackage.jsonto avoid Windows shebang execution limitations. - Add
tzinfo-datafor Windows Ruby platforms (and lock the added Windows platforms/gems inGemfile.lock). - Apply Windows/dev-only Shakapacker dev-server
static.publicPathworkaround and prevent a zero-size DB pool whenPUMA_WORKERS=0.
Reviewed changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Executes the Shakapacker dev server script through ruby for Windows compatibility. |
| Gemfile | Enables tzinfo-data only on Windows/JRuby platforms to provide zoneinfo data. |
| Gemfile.lock | Captures Windows platform additions and the tzinfo-data dependency in the lockfile. |
| config/shakapacker.yml | Pins dev_server.static.publicPath in development to a URL path to avoid Windows backslash route issues. |
| config/database.yml | Treats PUMA_WORKERS=0 as a single process to avoid a connection pool of zero. |
| .env.sample | Documents the Windows PUMA_WORKERS=0 local-dev workaround. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
fwextensions
marked this pull request as draft
August 8, 2026 02:03
fwextensions
marked this pull request as ready for review
August 13, 2026 02:51
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Four small changes that let the app run for local development on Windows. No application code is touched, and nothing here changes behavior on macOS or Linux.
Jira ticket
DAH-000 — developer environment setup, no ticket.
The changes
package.json— runbin/shakapacker-dev-serverthroughrubyexplicitly. Windowscmd.execan't execute a Ruby shebang script directly.Gemfile— uncommenttzinfo-datafor the Windows platforms. Windows ships no system zoneinfo database, and the gem is already platform-gated, so it isn't installed anywhere else.config/shakapacker.yml— pindev_server.static.publicPathto/packs/in thedevelopmentblock. Shakapacker'swebpackDevServerConfig.jsassigns the absolute filesystem output path there rather than a URL path; on Windows the backslashes breakpath-to-regexpwhen webpack-dev-server registers it as an Express route (Missing parameter name at index 2).config/database.yml— treatPUMA_WORKERS=0as one process when sizing the connection pool. Puma's clustered mode isn't supported on Windows, so single mode is set withPUMA_WORKERS=0, which meant a pool of0 * threads = 0..env.sample— document thePUMA_WORKERS=0workaround, commented out.Risk
The
database.ymlchange is the only one that isn't Windows- or development-scoped, so it's the one worth a careful look. It computesmax(PUMA_WORKERS, 1) * PUMA_THREADSinstead ofPUMA_WORKERS * PUMA_THREADS, which is identical for every value of 1 or higher — it only differs when the variable is explicitly set to0, where the old expression produced a pool of zero connections. The default of2is unaffected.The shakapacker override is inside the
development:block only. Thetzinfo-datagem is gated tomingw/mswin/x64_mingw/jrubyplatforms and does not install on macOS or Linux;Gemfile.lockgains the platform-specific entries.Review instructions
Applies to local development only; nothing to check in a deployed environment.
bundle install && npm startshould behave exactly as before. That is the real test here — that this is a no-op off Windows.PUMA_WORKERS=0set in.env,npm startshould boot both the Rails server and the webpack dev server, and the app should load.Verified on Windows 11 (the branch is what this environment is currently running on) and on macOS, where the app runs exactly as before — the no-op-off-Windows claim is confirmed, not assumed. Not verified on Linux.
🤖 Generated with Claude Code