Forum: Ruby require behavior in presence of two files of the same name

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Bb4bdf2b184027bc38d4fb529770cde5?d=identicon&s=25 Wes Gamble (weyus)
on 2008-12-04 19:16
If I do

  require 'x'

and there are two x.rb files somewhere on the load path, which one will
be require'd?

Thanks,
Wes
Ef3aa7f7e577ea8cd620462724ddf73b?d=identicon&s=25 Rob Biedenharn (Guest)
on 2008-12-04 20:23
(Received via mailing list)
On Dec 4, 2008, at 1:10 PM, Wes Gamble wrote:
> If I do
>
>  require 'x'
>
> and there are two x.rb files somewhere on the load path, which one
> will
> be require'd?
>
> Thanks,
> Wes


the first on that it finds while looking through the list in the load
path

-Rob

Rob Biedenharn    http://agileconsultingllc.com
Rob@AgileConsultingLLC.com
This topic is locked and can not be replied to.