# Require without .rb

**URL:** <https://rubytalk.org/t/require-without-rb/43643>\
**Category:** ruby-talk\
**Created:** [9 January 2008 13:45 UTC](https://rubytalk.org/t/require-without-rb/43643 "2008-01-09T13:45:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MistryMan4000](https://avatars.discourse-cdn.com/v4/letter/m/9de0a6/32.png) [@MistryMan4000](https://rubytalk.org/u/MistryMan4000)\
**Post date:** [9 January 2008 13:45 UTC](https://rubytalk.org/t/require-without-rb/43643/1 "2008-01-09T13:45:05Z")

</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

> **···**
>
> ---------------------------------  
> Looking for last minute shopping deals? Find them fast with Yahoo! Search.

---

<div class="post-metadata">

**Author:** ![botp1](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@botp1](https://rubytalk.org/u/botp1)\
**Post date:** [9 January 2008 13:56 UTC](https://rubytalk.org/t/require-without-rb/43643/2 "2008-01-09T13:56:49Z")

</div>

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

kind regards -botp

> **···**
>
> On Jan 9, 2008 9:45 PM, MistryMan4000@Yahoo.com \<mistryman4000@yahoo.com\> 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"?

---

<div class="post-metadata">

**Author:** ![Jair\_Rillo\_Junior](https://avatars.discourse-cdn.com/v4/letter/j/3be4f8/32.png) [@Jair\_Rillo\_Junior](https://rubytalk.org/u/Jair_Rillo_Junior)\
**Post date:** [9 January 2008 14:36 UTC](https://rubytalk.org/t/require-without-rb/43643/3 "2008-01-09T14:36:09Z")

</div>

MistryMan4000@Yahoo.com 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.

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).
