简体   繁体   中英

How to debug ruby code

I want to debug my Ruby code using the Ruby Mine IDE. In the drop down list Select Run/Debug Configuration , I chose My Project - development , then pressed Shift + F9 . The Debugger started well, but did not stop at my break points. Why?

Ensure your Gemfile contains this:

gem 'linecache19', '>= 0.5.13', :git => 'https://github.com/robmathews/linecache19 0.5.13.git'
gem 'ruby-debug-base19x', '>= 0.11.30.pre12'
gem 'ruby-debug-ide', '>= 0.4.17.beta17'

maybe for details see that answer

pry is an interactive Ruby shell (or "REPL"), which can be used as a debugger (best combined with the pry-nav and pry-stack_explorer gems). It has a lot of features which make it much nicer to use than the debugger gem. For general exploration and experimentation with Ruby code, it's also nicer to use than irb .

For more info:

http://pryrepl.org/

https://github.com/pry/pry

After adding pry to your Gemfile and bundling, you can add a "breakpoint" with the following Ruby code: binding.pry

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