Skip to content

Commit 7a790dc

Browse files
committedNov 17, 2023
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 5aa10e6 commit 7a790dc

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed
 

‎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

‎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)