# Locomotive and ruby-debug

**URL:** <https://www.ruby-forum.com/t/locomotive-and-ruby-debug/108847>\
**Category:** Rails\
**Created:** [July 8, 2007, 2:15am UTC](https://www.ruby-forum.com/t/locomotive-and-ruby-debug/108847 "2007-07-08T02:15:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![magic\_hat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/5daacb/32.png) [@magic\_hat](https://www.ruby-forum.com/u/magic_hat)\
**Post date:** [July 8, 2007, 2:15am UTC](https://www.ruby-forum.com/t/locomotive-and-ruby-debug/108847/1 "2007-07-08T02:15:45Z")

</div>

Anyone had success getting ruby-debug to work with Locomotive? I’ve  
got the ruby-debug gem installed, and require ‘ruby-debug’ in my  
config file, but when I try to call the debugger from within a rails  
method, the app just blows right by it and nothing appears in the  
console.

Any help with this would be appreciated.

---

<div class="post-metadata">

**Author:** ![magic\_hat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/5daacb/32.png) [@magic\_hat](https://www.ruby-forum.com/u/magic_hat)\
**Post date:** [July 8, 2007, 5:52am UTC](https://www.ruby-forum.com/t/locomotive-and-ruby-debug/108847/2 "2007-07-08T05:52:57Z")

</div>

If Locomotive is still using lighttpd, it won’t work. The best way to  
do it AFAIK is just:

rdebug script/server

or if you have the debugger started in your code, just use:

script/server

---

<div class="post-metadata">

**Author:** ![magic\_hat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/5daacb/32.png) [@magic\_hat](https://www.ruby-forum.com/u/magic_hat)\
**Post date:** [July 8, 2007, 8:28am UTC](https://www.ruby-forum.com/t/locomotive-and-ruby-debug/108847/3 "2007-07-08T08:28:04Z")

</div>

The EASIEST thing is to load the Footnotes plugin. Search for it at

[http://agilewebdevelopment.com/plugins](http://agilewebdevelopment.com/plugins)

Then load it using the standard plugin method. From your project  
directory:

script/plugin install  
[http://macromates.com/svn/Bundles/trunk/Bundles/Rails.tmbundle/Support/plugins/footnotes](http://macromates.com/svn/Bundles/trunk/Bundles/Rails.tmbundle/Support/plugins/footnotes)

Footnotes gives you extra goodness if you’re using TextMate – which  
you should anyway if you’re trying to learn or develop in RoR on a  
Mac. I’m PRETTY sure it works without TextMate.

What it does is automatically place ruby-debug like information on the  
bottom of each rendered page. Here’s what it looks like on my machine:

Edit: Controller | View | Layout | Stylesheets | Javascripts  
Show: Session | Cookies | Params | Log | General Debug  
(TextMate Footnotes)

Click on the link to show whatever and there you are! (The first line,  
Edit: won’t work without TextMate.) All this automatically turns off  
when you move to Production mode.

—Jim Gagne—

---

<div class="post-metadata">

**Author:** ![magic\_hat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/5daacb/32.png) [@magic\_hat](https://www.ruby-forum.com/u/magic_hat)\
**Post date:** [July 9, 2007, 7:51am UTC](https://www.ruby-forum.com/t/locomotive-and-ruby-debug/108847/4 "2007-07-09T07:51:22Z")

</div>

Why is locomotive essential? Can’t you start your app under webrick  
or mongrel for debugging? If you do that, it’s straightforward: Just  
require ‘ruby-debug’ and just before where you want to stop, call the  
debugger method.

---

<div class="post-metadata">

**Author:** ![magic\_hat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/5daacb/32.png) [@magic\_hat](https://www.ruby-forum.com/u/magic_hat)\
**Post date:** [July 9, 2007, 6:43am UTC](https://www.ruby-forum.com/t/locomotive-and-ruby-debug/108847/5 "2007-07-09T06:43:19Z")

</div>

Locomotive now runs on Mongrel, so this shouldn’t be a problem.  
Footnotes looks cool, but I need to be able to stop execution at a  
particular point and examine/change variables. I need  
a…uh…breakpointer.

Anyone who knows how to get ruby-debug working w/ Locomotive, please  
speak up! I’m getting desperate here.
