title: Debugging Sinatra application
body: <p>I install pry and try to use it. </p>
  
  <pre><code>gem "pry"    
  
  require 'pry'
  #..........
  binding.pry
  </code></pre>
  
  <p>But there are 3 issues :</p>
  
  <ul>
  <li>I don't know to go to the next string (not to the next break point) or watch the value of a variable. There is <strong>no information</strong> about it!</li>
  <li>there is a lot of different prys! pry-debug, pry, pry-db and so on and so forth. Which one should I use?</li>
  <li>It stops there it should. But I don't know yet (and didn't find) how to watch the variable's value or how to go to the next line. And it always gives in a few seconds a kind of an error below:</li>
  </ul>
  
  <pre>
  pry(#)> Error: execution expired
  /var/lib/gems/1.9.1/gems/pry-0.9.10/lib/pry/pry_instance.rb:600:in `getbyte'
  /var/lib/gems/1.9.1/gems/pry-0.9.10/lib/pry/pry_instance.rb:600:in `readline'
  /var/lib/gems/1.9.1/gems/pry-0.9.10/lib/pry/pry_instance.rb:600:in `block in readline'
  /var/lib/gems/1.9.1/gems/pry-0.9.10/lib/pry/pry_instance.rb:544:in `handle_read_errors'
  /var/lib/gems/1.9.1/gems/pry-0.9.10/lib/pry/pry_instance.rb:589:in `readline'
  /var/lib/gems/1.9.1/gems/pry-0.9.10/lib/pry/pry_instance.rb:369:in `retrieve_line'
  /var/lib/gems/1.9.1/gems/pry-0.9.10/lib/pry/pry_instance.rb:304:in `block in r'
  /var/lib/gems/1.9.1/gems/pry-0.9.10/lib/pry/pry_instance.rb:301:in `loop'
  /var/lib/gems/1.9.1/gems/pry-0.9.10/lib/pry/pry_instance.rb:301:in `r'
  /var/lib/gems/1.9.1/gems/pry-0.9.10/lib/pry/pry_instance.rb:271:in `re'
  /var/lib/gems/1.9.1/gems/pry-0.9.10/lib/pry/pry_instance.rb:251:in `rep'
  /var/lib/gems/1.9.1/gems/pry-0.9.10/lib/pry/pry_instance.rb:231:in `block (3 levels) in repl'
  /var/lib/gems/1.9.1/gems/pry-0.9.10/lib/pry/pry_instance.rb:230:in `loop'
  /var/lib/gems/1.9.1/gems/pry-0.9.10/lib/pry/pry_instance.rb:230:in `block (2 levels) in repl'
  /var/lib/gems/1.9.1/gems/pry-0.9.10/lib/pry/pry_instance.rb:229:in `catch'
  /var/lib/gems/1.9.1/gems/pry-0.9.10/lib/pry/pry_instance.rb:229:in `block in repl'
  /var/lib/gems/1.9.1/gems/pry-0.9.10/lib/pry/pry_instance.rb:228:in `catch'
  /var/lib/gems/1.9.1/gems/pry-0.9.10/lib/pry/pry_instance.rb:228:in `repl'
  /var/lib/gems/1.9.1/gems/pry-0.9.10/lib/pry/pry_class.rb:154:in `start'
  /var/lib/gems/1.9.1/gems/pry-0.9.10/lib/pry/core_extensions.rb:22:in `pry'
  /home/alex/Documents/ruby/my_projects/controllers/my_controller.rb:24:in `block in '
  /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:1265:in `call'
  /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:1265:in `block in compile!'
  /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:835:in `[]'
  /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:835:in `block (3 levels) in route!'
  /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:851:in `route_eval'
  /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:835:in `block (2 levels) in route!'
  /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:872:in `block in process_route'
  /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:870:in `catch'
  /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:870:in `process_route'
  /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:834:in `block in route!'
  /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:833:in `each'
  /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:833:in `route!'
  /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:936:in `dispatch!'
  /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:769:in `block in call!'
  /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:921:in `block in invoke'
  /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:921:in `catch'
  /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:921:in `invoke'
  /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:769:in `call!'
  /home/alex/Documents/ruby/my_projects/app.rb:21:in `block in '
  /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:1265:in `call'
  /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:1265:in `block in compile!'
  /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:835:in `[]'
  /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:835:in `block (3 levels) in route!'
  /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:851:in `route_eval'
  /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:835:in `block (2 levels) in route!'
  /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:872:in `block in process_route'
  /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:870:in `catch'
  /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:870:in `process_route'
  /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:834:in `block in route!'
  /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:833:in `each'
  /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:833:in `route!'
  /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:936:in `dispatch!'
  /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:769:in `block in call!'
  /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:921:in `block in invoke'
  /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:921:in `catch'
  /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:921:in `invoke'
  /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:769:in `call!'
  /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:755:in `call'
  /var/lib/gems/1.9.1/gems/rack-flash3-1.0.1/lib/rack/flash.rb:120:in `call'
  /var/lib/gems/1.9.1/gems/rack-timeout-0.0.3/lib/rack/timeout.rb:16:in `block in call'
  /usr/lib/ruby/1.9.1/timeout.rb:68:in `timeout'
  /var/lib/gems/1.9.1/gems/rack-timeout-0.0.3/lib/rack/timeout.rb:16:in `call'
  /var/lib/gems/1.9.1/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:205:in `context'
  /var/lib/gems/1.9.1/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:200:in `call'
  /var/lib/gems/1.9.1/gems/rack-protection-1.2.0/lib/rack/protection/xss_header.rb:22:in `call'
  /var/lib/gems/1.9.1/gems/rack-protection-1.2.0/lib/rack/protection/path_traversal.rb:16:in `call'
  /var/lib/gems/1.9.1/gems/rack-protection-1.2.0/lib/rack/protection/json_csrf.rb:17:in `call'
  /var/lib/gems/1.9.1/gems/rack-protection-1.2.0/lib/rack/protection/base.rb:47:in `call'
  /var/lib/gems/1.9.1/gems/rack-protection-1.2.0/lib/rack/protection/xss_header.rb:22:in `call'
  /var/lib/gems/1.9.1/gems/rack-1.4.1/lib/rack/logger.rb:15:in `call'
  /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:129:in `call'
  /var/lib/gems/1.9.1/gems/rack-1.4.1/lib/rack/head.rb:9:in `call'
  /var/lib/gems/1.9.1/gems/rack-1.4.1/lib/rack/methodoverride.rb:21:in `call'
  /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/showexceptions.rb:21:in `call'
  /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:99:in `call'
  /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:1389:in `block in call'
  /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:1471:in `synchronize'
  /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:1389:in `call'
  /var/lib/gems/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:134:in `call'
  /var/lib/gems/1.9.1/gems/rack-1.4.1/lib/rack/urlmap.rb:64:in `block in call'
  /var/lib/gems/1.9.1/gems/rack-1.4.1/lib/rack/urlmap.rb:49:in `each'
  /var/lib/gems/1.9.1/gems/rack-1.4.1/lib/rack/urlmap.rb:49:in `call'
  /var/lib/gems/1.9.1/gems/rack-1.4.1/lib/rack/lint.rb:48:in `_call'
  /var/lib/gems/1.9.1/gems/rack-1.4.1/lib/rack/lint.rb:36:in `call'
  /var/lib/gems/1.9.1/gems/rack-1.4.1/lib/rack/showexceptions.rb:24:in `call'
  /var/lib/gems/1.9.1/gems/rack-1.4.1/lib/rack/commonlogger.rb:20:in `call'
  /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:136:in `call'
  /var/lib/gems/1.9.1/gems/rack-1.4.1/lib/rack/chunked.rb:43:in `call'
  /var/lib/gems/1.9.1/gems/rack-1.4.1/lib/rack/content_length.rb:14:in `call'
  /var/lib/gems/1.9.1/gems/rack-1.4.1/lib/rack/handler/webrick.rb:59:in `service'
  /usr/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
  /usr/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
  /usr/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'
  pry(#)> 
  </pre>
  
  <p>Alright, I install </p>
  
  <pre><code>gem "debugger"
  </code></pre>
  
  <p>and add the breakpoint</p>
  
  <pre><code>debugger
  </code></pre>
  
  <p>Nothing happens at all.</p>
  
  <p>Log file is not what I'm looking for. I just want to debug a Sinatra application. How do I do that?</p>