# Path to loaded module?

**URL:** <https://www.ruby-forum.com/t/path-to-loaded-module/52516>\
**Category:** Ruby\
**Created:** [January 15, 2006, 5:52pm UTC](https://www.ruby-forum.com/t/path-to-loaded-module/52516 "2006-01-15T17:52:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonathan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/aeb1de/32.png) [@jonathan](https://www.ruby-forum.com/u/jonathan)\
**Post date:** [January 15, 2006, 5:52pm UTC](https://www.ruby-forum.com/t/path-to-loaded-module/52516/1 "2006-01-15T17:52:32Z")

</div>

Hello,

Is there any way to get the path of a loaded module ?  
I think I have two concurent versions of the same module and I can’t  
figure which one is loaded.

Thx,  
Jonathan.

---

<div class="post-metadata">

**Author:** ![jonathan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/aeb1de/32.png) [@jonathan](https://www.ruby-forum.com/u/jonathan)\
**Post date:** [January 17, 2006, 10:35pm UTC](https://www.ruby-forum.com/t/path-to-loaded-module/52516/2 "2006-01-17T22:35:37Z")

</div>

Here is something to try:

def script\_find(name)  
name += ‘.rb.’ if name !~ /.rb$/  
$LOAD\_PATH.inject([]) do |result, path|  
if test(?e, File.join(path, name))  
result \<\< path  
end  
result  
end  
end  
p script\_find(‘singleton’)

Ryan
