# Komodo debugger question

**URL:** <https://www.ruby-forum.com/t/komodo-debugger-question/122276>\
**Category:** Ruby\
**Created:** [December 6, 2007, 4:14am UTC](https://www.ruby-forum.com/t/komodo-debugger-question/122276 "2007-12-06T04:14:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jimc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ba8739/32.png) [@jimc](https://www.ruby-forum.com/u/jimc)\
**Post date:** [December 6, 2007, 4:14am UTC](https://www.ruby-forum.com/t/komodo-debugger-question/122276/1 "2007-12-06T04:14:01Z")

</div>

I writing my first gem and have a question about how to set up Komodo  
4.2 to debug it correctly.

My project has three directories: lib, test, and examples. Now if I open  
up a DOS window to the top level project directory and run my example  
code such as “ruby examples/file\_example.rb”, it runs fine. However,  
when I debug, Komodo doesn’t understand my path structure such that if I  
open up file\_example.rb and start the debugger, I get a “no such file to  
load” on my require statement.

So, how do I set up Komodo to understand that it should look in the lib  
directory to find the ‘require’ file?

Thanks in advance.

-Jim

---

<div class="post-metadata">

**Author:** ![jimc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ba8739/32.png) [@jimc](https://www.ruby-forum.com/u/jimc)\
**Post date:** [December 6, 2007, 7:30am UTC](https://www.ruby-forum.com/t/komodo-debugger-question/122276/2 "2007-12-06T07:30:30Z")

</div>

> My project has three directories: lib, test, and examples. Now if I  
> open up a DOS window to the top level project directory and run my  
> example code such as “ruby examples/file\_example.rb”, it runs fine.  
> However, when I debug, Komodo doesn’t understand my path structure  
> such that if I open up file\_example.rb and start the debugger, I get a  
> “no such file to load” on my require statement.
> 
> So, how do I set up Komodo to understand that it should look in the  
> lib directory to find the ‘require’ file?  
> Never mind. I found a better cross-platform way in the pickaxe 2nd ed.  
> page 160. What I do is “… a little load path magic” and put this  
> before my require statements:

$:.unshift File.join(File.dirname( **FILE** ), “…”, “lib”)

With this it doesn’t matter which directory I start the code from and it  
works.

Cheers,  
Jim
