# Return value of require

**URL:** <https://www.ruby-forum.com/t/return-value-of-require/169289>\
**Category:** Ruby\
**Created:** [June 1, 2009, 11:51pm UTC](https://www.ruby-forum.com/t/return-value-of-require/169289 "2009-06-01T23:51:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Detlef\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/58f4c7/32.png) [@Detlef\_R](https://www.ruby-forum.com/u/Detlef_R)\
**Post date:** [June 1, 2009, 11:51pm UTC](https://www.ruby-forum.com/t/return-value-of-require/169289/1 "2009-06-01T23:51:18Z")

</div>

Hi,

I had a problem with require and ruby 1.8.7-p72 on debian (original  
debian packages).

For some of the ruby-gnome2 libraries (all, which are based on gtk),  
require returned false. Beside of the return value all works like  
expected.

With an upgrade to 1.8.7-p160 and compiling ruby from source, all  
libraries return true on require, as expected.

Can someone tell me, in which version this change was made?

Cheers, detlef

---

<div class="post-metadata">

**Author:** ![Detlef\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/58f4c7/32.png) [@Detlef\_R](https://www.ruby-forum.com/u/Detlef_R)\
**Post date:** [June 2, 2009, 10:10am UTC](https://www.ruby-forum.com/t/return-value-of-require/169289/2 "2009-06-02T10:10:55Z")

</div>

Detlef R. wrote:

> I had a problem with require and ruby 1.8.7-p72 on debian (original  
> debian packages).
> 
> For some of the ruby-gnome2 libraries (all, which are based on gtk),  
> require returned false. Beside of the return value all works like  
> expected.
> 
> With an upgrade to 1.8.7-p160 and compiling ruby from source, all  
> libraries return true on require, as expected.
> 
> Can someone tell me, in which version this change was made?

I’m don’t see what the problem is. require returns false if the library  
has already been loaded, and true if it is loaded for the first time at  
that point.

$ irb --simple-prompt

> > require ‘openssl’  
> > =\> true
> 
> > require ‘openssl’  
> > =\> false
> 
> >

If some of the ruby-gnome2 libraries returned false, it’s probably just  
because some previous library that you required in turn required those  
other libraries.

If you want to investigate further,

```
puts $LOADED_FEATURES

```

will probably be of help.

Regards,

Brian.
