Commit 2306825
Fix bin/dev showing 'Process Manager Not Found' when overmind exists but exits (#2087)
## Summary
Fixes a bug where `bin/dev` shows the misleading error "Process Manager
Not Found" when overmind is installed but exits with a non-zero code
(e.g., when a Procfile process crashes).
## Problem
After the v16.2.0.beta.12 release, users reported seeing:
```
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ERROR: Process Manager Not Found
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
To run the React on Rails development server, you need either 'overmind' or
'foreman' installed on your system.
```
This error appeared even though overmind was installed and working. It
occurred when overmind successfully started but then exited with a
non-zero code (e.g., when a process in the Procfile died).
## Root Cause
The `run_with_process_manager` method couldn't distinguish between:
- Process not found (should show installation help)
- Process found but exited with error (should just exit, process manager
already showed its error)
The old logic:
```ruby
return if run_process_if_available("overmind", ...)
return if run_process_if_available("foreman", ...)
show_process_manager_installation_help # Always shown if neither returned!
```
When `system('overmind', 'start', '-f', procfile)` exited with error, it
returned `false`, not `nil`, so the code continued to try foreman. If
foreman wasn't installed, it showed the "not found" message incorrectly.
## Solution
Changed `run_process_if_available` to return **three distinct states**:
- `true`: Process found and exited successfully (exit code 0)
- `false`: Process found but exited with error (non-zero exit code)
- `nil`: Process not found/available
Updated the error handling logic:
```ruby
overmind_result = run_process_if_available("overmind", ...)
return if overmind_result == true # Success!
foreman_result = run_process_if_available("foreman", ...)
return if foreman_result == true # Success!
# If found but failed, exit silently (they showed their own errors)
exit 1 if overmind_result == false || foreman_result == false
# Only show "not found" if NEITHER was found
show_process_manager_installation_help
exit 1
```
## Testing
- ✅ Verified overmind detection still works correctly
- ✅ Tested scenario where overmind exits with error - correctly exits
without showing "not found"
- ✅ Tested scenario where neither is installed - correctly shows
installation help
- ✅ RuboCop passes
- ✅ RBS signatures updated and validated
- ✅ Manual testing in spec/dummy
## Impact
Users will no longer see the confusing "Process Manager Not Found" error
when their process manager is actually installed but a Procfile process
crashes or exits with error.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude <[email protected]>1 parent 3bd2f10 commit 2306825
File tree
3 files changed
+66
-8
lines changed- lib/react_on_rails/dev
- sig/react_on_rails/dev
- spec/react_on_rails/dev
3 files changed
+66
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
41 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
42 | 53 | | |
43 | 54 | | |
44 | 55 | | |
| |||
73 | 84 | | |
74 | 85 | | |
75 | 86 | | |
76 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
77 | 91 | | |
78 | 92 | | |
79 | 93 | | |
| |||
82 | 96 | | |
83 | 97 | | |
84 | 98 | | |
85 | | - | |
| 99 | + | |
86 | 100 | | |
87 | 101 | | |
88 | 102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
74 | 94 | | |
75 | 95 | | |
76 | 96 | | |
77 | 97 | | |
| 98 | + | |
| 99 | + | |
78 | 100 | | |
79 | 101 | | |
80 | 102 | | |
81 | 103 | | |
82 | | - | |
| 104 | + | |
83 | 105 | | |
84 | 106 | | |
85 | 107 | | |
86 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
87 | 131 | | |
88 | 132 | | |
89 | 133 | | |
| |||
117 | 161 | | |
118 | 162 | | |
119 | 163 | | |
120 | | - | |
| 164 | + | |
121 | 165 | | |
122 | 166 | | |
123 | 167 | | |
124 | 168 | | |
125 | | - | |
| 169 | + | |
126 | 170 | | |
127 | 171 | | |
128 | 172 | | |
| |||
0 commit comments