[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Re: require doesn't load non-rb files

James Britt

4/20/2007 6:25:00 AM

Volkan Civelek wrote:
> hi,
> i know it sounds so trivial but couldn't tackle...
> here it is...
>
> let's say you have foo.so file.
> at the same folder you have bar.rb file and on that bar.rb file you
> require 'foo.so'
>
> ruby bar.rb gives "No such file to load" error....
>
> if you rename foo.so with foo.rb and modify bar.rb like require 'foo' or require 'foo.rb'
> it all just fine...
>
> any suggestions are greatly appreciated....

http://www.ruby-doc.org/core/classes/Kernel.ht...

Leave off the file extension. Ruby has its own logic for working that
out with 'require'.

require 'foo'


--
James Britt

"I must create a system, or be enslaved by another man's;
I will not reason and compare; my business is to create."
- William Blake