1) run it with ruby’s normal debugger -rdebug [1] kind of slow
2) run it with unroller gem [kind of stinks, way slow]
3) use a lot of print statements fast, kind of less introspection possible
4) drop to an irb prompt and run some code from there.
you could list the code by creating your own “drop to irb prompt” that listed the code around itself [use caller to discover where you where] then drop to a normal irb prompt.
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.
Just an add on about this with rvm, ruby 1.9.1-p378.
True story is that even if ruby-debug is 1.9.x ready, linecache-0.43 is not.
The solution is to install:
gem install ruby-debug19
This solves the problem for me.
OLD UPDATE
If you are having problems with ruby 1.9.2 and Rails 3 debugging putting:
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!
It just works. - And it is included in the rails Gemfile since 3.2.something to replace ruby-debug19. It has the exact same functionality and is actively maintained.
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:##