# 'requires lib/customException.rb' seems to need full path?

**URL:** <https://www.ruby-forum.com/t/requires-lib-customexception-rb-seems-to-need-full-path/107034>\
**Category:** Rails\
**Created:** [June 16, 2007, 11:51pm UTC](https://www.ruby-forum.com/t/requires-lib-customexception-rb-seems-to-need-full-path/107034 "2007-06-16T23:51:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![greg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/71c47a/32.png) [@greg](https://www.ruby-forum.com/u/greg)\
**Post date:** [June 16, 2007, 11:51pm UTC](https://www.ruby-forum.com/t/requires-lib-customexception-rb-seems-to-need-full-path/107034/1 "2007-06-16T23:51:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![greg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/71c47a/32.png) [@greg](https://www.ruby-forum.com/u/greg)\
**Post date:** [June 17, 2007, 12:52am UTC](https://www.ruby-forum.com/t/requires-lib-customexception-rb-seems-to-need-full-path/107034/2 "2007-06-17T00:52:04Z")

</div>

On 16-Jun-07, at 5:50 PM, Greg H. wrote:

> 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

---

<div class="post-metadata">

**Author:** ![greg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/71c47a/32.png) [@greg](https://www.ruby-forum.com/u/greg)\
**Post date:** [June 17, 2007, 5:28am UTC](https://www.ruby-forum.com/t/requires-lib-customexception-rb-seems-to-need-full-path/107034/3 "2007-06-17T05:28:24Z")

</div>

ok - so I must have a problem with my load path “/lib” not loading  
properly  
I guess…ummm
