Skip to content

Commit

Permalink
Lazily load the debugger gem
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
elia authored and flavorjones committed Jan 4, 2024
1 parent cbc1ca7 commit 313f257
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/install/Procfile.dev
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
web: env RUBY_DEBUG_OPEN=true bin/rails server
web: bin/rails server
css: bin/rails tailwindcss:watch
5 changes: 5 additions & 0 deletions lib/install/dev
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,9 @@ fi
# Default to port 3000 if not specified
export PORT="${PORT:-3000}"

# Let the debug gem allow remote connections,
# but avoid loading until `debugger` is called
export RUBY_DEBUG_OPEN="true"
export RUBY_DEBUG_LAZY="true"

exec foreman start -f Procfile.dev "$@"

0 comments on commit 313f257

Please sign in to comment.