# Require without .rb

**URL:** <https://www.ruby-forum.com/t/require-without-rb/125478>\
**Category:** Ruby\
**Created:** [January 9, 2008, 2:45pm UTC](https://www.ruby-forum.com/t/require-without-rb/125478 "2008-01-09T14:45:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [January 9, 2008, 2:45pm UTC](https://www.ruby-forum.com/t/require-without-rb/125478/1 "2008-01-09T14:45:58Z")

</div>

How can I make my programs not need to be called \*.rb in the require  
statment? If I have a script called notepad/component.rb, how do make it  
so that notepad.rb can say require “notepad/component” instead of  
“notepad/component.rb”?

Thank you

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [January 9, 2008, 2:57pm UTC](https://www.ruby-forum.com/t/require-without-rb/125478/2 "2008-01-09T14:57:41Z")

</div>

On Jan 9, 2008 9:45 PM, removed\_email\_address@domain.invalid  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> How can I make my programs not need to be called \*.rb in the require  
> statment? If I have a script called notepad/component.rb, how do make  
> it so that notepad.rb can say require “notepad/component” instead of  
> “notepad/component.rb”?

have you tried it? (pls post your sample code)

kind regards -botp

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [January 9, 2008, 3:36pm UTC](https://www.ruby-forum.com/t/require-without-rb/125478/3 "2008-01-09T15:36:15Z")

</div>

removed\_email\_address@domain.invalid wrote:

> How can I make my programs not need to be called \*.rb in the require  
> statment? If I have a script called notepad/component.rb, how do make it  
> so that notepad.rb can say require “notepad/component” instead of  
> “notepad/component.rb”?
> 
> Thank you

Hi  
You do not need to put the .rb in require.  
Try a simple command:  
require “dbi” and see the result.
