Debugging in ruby 1.9

2020-01-23 15:37发布

What do you guys use for debugging in ruby 1.9? rdebug doesn't seem to be compatible.. is there anything out there?

12条回答
冷血范
2楼-- · 2020-01-23 16:01

Netbeans is a good IDE for RoR. Good debugger too.

查看更多
狗以群分
3楼-- · 2020-01-23 16:08

The ruby 1.9.1-p243 version is out and compitable ruby-debug-ide is also working properly. Install ruby-debug-ide using the following command:

gem install ruby-debug-ide

This will install the ruby-debug-base19 and ruby-debug-ide gems. But before this make sure you install the mingw successfully by following the Development kit docs available from RubyForge.

查看更多
叛逆
4楼-- · 2020-01-23 16:09

doesn't anyone use: ruby -rdebug script.rb

then you can use: b script.rb:## (where ## is the line number of a valid ruby command) otherwise you are going to maybe be in the middle of rubygems or one of your required chunks of code.

Then you can simply set the next breakpoint as b:##

查看更多
家丑人穷心不美
5楼-- · 2020-01-23 16:10

If you still have a problem after installing ruby-debug19 try updating ruby-debug-base19. I had errors and couldn't run WEBrick in debug mode until I did that.

gem update ruby-debug-base19

Oh, and thanks Mr. Moseley for all your hard work!

查看更多
Rolldiameter
6楼-- · 2020-01-23 16:14

I used following and it works great for me:

gem 'debugger', group: [:development, :test]

ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux] rails 3.2.8

查看更多
Viruses.
7楼-- · 2020-01-23 16:20

There is a lot of choices, depending on your needs.

I use pry-moves because I can "look back" into what happened inside of previous command by re-executing them in debug mode right from the place.

查看更多
登录 后发表回答