views:

651

answers:

4

I know Emacs has some sort of integration with gdb (though I never used it) to jump through files as you debug a program. I'd like to do the same with Ruby programs.

+1  A: 

You may want use rdebug.

erenon
+4  A: 

As erenon said, use ruby debug, which provides a library for emacs that lets you use it just as gdb.

Install rdebug by issuing this command on your terminal(the sudo is optional, depending on your system):

<sudo> gem install ruby-debug

You then need to download the ruby-debug-extra file from rubyforge, and install it in the standard way.

  sh ./configure
  make
  make test # optional, but a good idea
  sudo make install

This gives you the elisp files for the interaction with rdebug, plus documentation for ruby-debug that can be viewed from within emacs.

AJ

Adulteratedjedi
Thanks! As a note, I also had to install (in Ubuntu) the packages `texi2html` and `texinfo` before compiling `ruby-debug-extra`, but it worked.
obvio171
+1  A: 

I am getting "Cannot open load file: gdb-ui" in GNU Emacs 23.1.50.1 (x86_64-apple-darwin10.0.0, NS apple-appkit-1038.11) of 2009-10-31

Cezar
Did you ever come up with a workaround for this? I'm running into the same problem.
Clint Miller
A: 

Hi everyone! I was stuck with same problem with gdb-ui, but I found the solution: I downloaded gdb-ui.el from here and put it into ruby-debug-extra/emacs dir... then I've adjusted Makefiles to point to this file before any other rdebug*.el files. After this step you'll get make working. Since I'm using emacs-snapshot and gdb mode is available already in my emacs environment, this issue is only about to build rdebug mode. After this I've installed it with "sudo make install" and it works perfectly :) Don't forget to add (require 'rdebug) to your ~/.emacs or whatever else you use to bootstrap your config.

alecnmk