I installed the debugger gem in a project i'm working on. They are using thin server with ssl. When I put a debugger in the code, it doesn't trigger until I restart the server. And then if I remove a debugger, it doesn't go away until I restart the server. Any ideas why this is happening?
3 Answers
It depends on where you place the debugger. Rails is configured to reload all the content of /app
on every request. If you place the debugger
call there, then it will be reloaded on every request.
Otherwise, if you place it somewhere else, for example in lib
, then it will not.
Also, you may want to use the debugger in combination of automated testing, rather than browser testing. It will make the test more effective.

- 173,507
- 49
- 363
- 364
-
I placed the debugger in /app, but it wasn't getting loaded unless I restart the server. – Matthew Berman Mar 27 '13 at 18:34
In order to use debugger with thin, you need to start rails server with --debugger prompt
rails s --debugger
whenever server encounters debugger statement, rails server connect to debug console. No other request will be served in that context. when you finish up with debugging by continue statement or no break point remain, then server start behaving normally until it encounter debugger statement again.

- 7,949
- 3
- 25
- 54
-
I use thin --ssl start to get the server running...should I add --debugger to that to get it working properly? – Matthew Berman Mar 27 '13 at 18:29
-
1Are you using the thin-rails gem for this server or anything else? If yes, you can start thin using **rails server** and rails by default this will be used. Other wise check the thin option by **thin -h** – maximus ツ Mar 27 '13 at 18:45