[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: require with absolute path

Alex Young

10/20/2007 10:06:00 AM

Ayhan Molla wrote:
> Hi,
> I am trying to require the xml builder library using the require statement as follows:
>
> require 'C:/builder-2.1.2/lib/builder.rb'
>
> builder.rb in turn has two requires inside using relative paths:
>
> require 'builder/xmlmarkup'
> require 'builder/xmlevents'
>
> Althougn those files exists in the builder directory, ruby complains and give this error:
> require': no such file to load -- builder/xmlmarkup (LoadError)
>
> This is strange since $: variable has "." evertime it loads a file, so it should find the files in "builder" folder. What is the correct way to load the files in that case? put everything under ruby lib folder so that they are in $: ?
Doesn't the "." refer to the cwd of the ruby process, rather than the
directory of the file that contains it?

--
Alex