# Require behavior in presence of two files of the same name

**URL:** <https://www.ruby-forum.com/t/require-behavior-in-presence-of-two-files-of-the-same-name/154878>\
**Category:** Ruby\
**Created:** [December 4, 2008, 7:16pm UTC](https://www.ruby-forum.com/t/require-behavior-in-presence-of-two-files-of-the-same-name/154878 "2008-12-04T19:16:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![weyus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7ab992/32.png) [@weyus](https://www.ruby-forum.com/u/weyus)\
**Post date:** [December 4, 2008, 7:16pm UTC](https://www.ruby-forum.com/t/require-behavior-in-presence-of-two-files-of-the-same-name/154878/1 "2008-12-04T19:16:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![weyus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7ab992/32.png) [@weyus](https://www.ruby-forum.com/u/weyus)\
**Post date:** [December 4, 2008, 8:23pm UTC](https://www.ruby-forum.com/t/require-behavior-in-presence-of-two-files-of-the-same-name/154878/2 "2008-12-04T20:23:52Z")

</div>

On Dec 4, 2008, at 1:10 PM, Wes G. 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 B. [http://agileconsultingllc.com](http://agileconsultingllc.com)  
removed\_email\_address@domain.invalid
