Simply Disply How to debug sinatra application with debugger or pry
especially, I would like to step in method debug like below
# added to the Gemfilegroup:development,:testdogem'awesome_print'gem'racksh'gem'debugger'gem'pry'gem'pry-debugger'endYou can just use debugger, if you run it ruby my_app.rb
classMyApp < Sinatra::Baseenable:sessionsget'/'dodebuggersession[:user]='anonymouse'redirectto('/bar')endvisit at http://localhost:4567
You can use pry, if you run it rackup
classMyApp < Sinatra::Baseenable:sessionsget'/'dobinding.prysession[:user]='anonymouse'redirectto('/bar')endin case to use the short cut of next contine step finish add pry config
#.pryrcPry.commands.alias_command'c','continue'Pry.commands.alias_command's','step'Pry.commands.alias_command'n','next'Pry.commands.alias_command'f','finish'visit at http://localhost:9292
ruby my_app.rb
rackup
You may also would like to know how to run console for sinatra and simulate a get or post call from console, try racksh



