Skip to content

Commit 313f257

Browse files
eliaflavorjones
authored andcommitted
Lazily load the debugger gem
Some docker environments will trigger an error related to unix sockets and permissions on temporary folders. Loading the debugger lazily mitigates the issue so at least rails can be started without crashing, while keeping the remote debugging available for other environments that support it.
1 parent cbc1ca7 commit 313f257

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Diff for: lib/install/Procfile.dev

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
web: env RUBY_DEBUG_OPEN=true bin/rails server
1+
web: bin/rails server
22
css: bin/rails tailwindcss:watch

Diff for: lib/install/dev

+5
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,9 @@ fi
88
# Default to port 3000 if not specified
99
export PORT="${PORT:-3000}"
1010

11+
# Let the debug gem allow remote connections,
12+
# but avoid loading until `debugger` is called
13+
export RUBY_DEBUG_OPEN="true"
14+
export RUBY_DEBUG_LAZY="true"
15+
1116
exec foreman start -f Procfile.dev "$@"

0 commit comments

Comments
 (0)