简体   繁体   中英

How do I get ruby debugger to work in sinatra with shotgun?

Is there a way of running shotgun to allow for ruby debugger statements to run? the -d flag seems to be just for debugging output.

In order to find the best way to debug sinatra app, I created a repo at github. The most useful part is step into method debug, which looks like below.

在此输入图像描述

Here is the repo: https://github.com/hlee/sinatra_debugger_example

I also confirmed this example support shotgun as well. try as below

cd sinatra_debugger_example
bundle
shotgun config.ru

and visit: http://localhost:9393 , you will be able to use pry debug and stepping.

About debugger & pry:

  1. the example project support both debugger and pry.
  2. I personally perfer pry better.

I hope it helps you.

此链接应该有助于: 机架应用程序的ruby调试器

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM