Problem understanding paths in Rails and ActionMailer

I'm having difficulty understanding how Rails and ActionMailer, or any
Ruby app for that matter, decide what paths to search to resolve
'require' statements. It seems to be 75% auto-magical and the other 25%
of the time it breaks. I had, for example, a great deal of trouble
sharing a partial between Rails and a call to ActionMailer to render an
HTML email.

In Java you have class path. In .NET it's either in the same directory
or in the GAC. How does it work in Ruby? Is there a consistent strategy
I can follow? What debugging tricks can I use to figure out why File X
can't find File Y?

Thanks for any help you can provide!

Kevin

I'm having difficulty understanding how Rails and ActionMailer, or any
Ruby app for that matter, decide what paths to search to resolve
'require' statements. It seems to be 75% auto-magical and the other 25%
of the time it breaks. I had, for example, a great deal of trouble
sharing a partial between Rails and a call to ActionMailer to render an
HTML email.

In Java you have class path. In .NET it's either in the same directory
or in the GAC. How does it work in Ruby? Is there a consistent strategy
I can follow? What debugging tricks can I use to figure out why File X
can't find File Y?

Thanks for any help you can provide!

Can't help you with the particulars, although seems I did read about it somewhere once, but in Ruby $: holds the list of directories to search for required files in...

So, if you start up script/console you can print that out and see what it contains. I'd imagine it's the same for all parts of rails, but you could always log it at various points to see what it has to say.

-philip