0

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?

maximus ツ
  • 7,949
  • 3
  • 25
  • 54
Matthew Berman
  • 8,481
  • 10
  • 49
  • 98

3 Answers3

0

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.

Simone Carletti
  • 173,507
  • 49
  • 363
  • 364
0

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.

maximus ツ
  • 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
  • 1
    Are 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
0

using this command fixed it:

thin --ssl --debug start
Matthew Berman
  • 8,481
  • 10
  • 49
  • 98