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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Philip Hallstrom
2006-Dec-08 18:09 UTC
Re: 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!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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---