Greg Hauptmann
2007-Jun-16 21:50 UTC
''requires lib/customException.rb'' seems to need full path????
Hi, My require ''lib/commonException.rb'' line in application.rb works OK locally HOWEVER on my hosting provider I get a " no such file to load -- lib/commonException.rb". I put the full path into the require statement and that seemed to fix it however I shouldn''t leave a hardwired path in there. So: Question = When using a requires statement to require a custom *.rb file one has created and put in the application "/lib" area, should I only need to reference it like I have done via "lib/..."? If yes, any ideas why I get an error. If no, what would be the recommended approach to reference it? Thanks Greg --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Jodi Showers
2007-Jun-16 22:50 UTC
Re: ''requires lib/customException.rb'' seems to need full path????
On 16-Jun-07, at 5:50 PM, Greg Hauptmann wrote:> Hi, > > My require ''lib/commonException.rb'' line in application.rb works OK > locally HOWEVER on my hosting provider I get a " no such file to > load -- lib/commonException.rb". I put the full path into the > require statement and that seemed to fix it however I shouldn''t > leave a hardwired path in there. So: > > Question = When using a requires statement to require a custom *.rb > file one has created and put in the application "/lib" area, should > I only need to reference it like I have done via "lib/..."? If > yes, any ideas why I get an error. If no, what would be the > recommended approach to reference it?Greg, I don''t ever put paths into requires (unless I want to get below the load path, or be very specific) .lib is in your load path, so you shouldn''t need to require the path. Cheers, Jodi --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Greg Hauptmann
2007-Jun-17 03:28 UTC
Re: ''requires lib/customException.rb'' seems to need full path????
ok - so I must have a problem with my load path "/lib" not loading properly I guess...ummm On 6/17/07, Jodi Showers <jodi-BOB1p6JRLoAV+D8aMU/kSg@public.gmane.org> wrote:> > > On 16-Jun-07, at 5:50 PM, Greg Hauptmann wrote: > > Hi, > > > My require ''lib/commonException.rb'' line in application.rb works OK > locally HOWEVER on my hosting provider I get a " no such file to load -- > lib/commonException.rb". I put the full path into the require statement and > that seemed to fix it however I shouldn''t leave a hardwired path in there. > So: > > > *Question* = When using a requires statement to require a custom *.rb file > one has created and put in the application "/lib" area, should I only need > to reference it like I have done via "lib/..."? If yes, any ideas why I get > an error. If no, what would be the recommended approach to reference it? > > > Greg, > > I don''t ever put paths into requires (unless I want to get below the load > path, or be very specific) > .lib is in your load path, so you shouldn''t need to require the path. > > Cheers, > Jodi > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---