'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

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

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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs