Komodo debugger question

J

Jim Clark

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
 
J

Jim Clark

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,219
Messages
2,571,118
Members
47,738
Latest member
Aracely45I

Latest Threads

Top