# Very lost with rubygems and required files

**URL:** <https://www.ruby-forum.com/t/very-lost-with-rubygems-and-required-files/58012>\
**Category:** Ruby\
**Created:** [April 17, 2006, 6:57pm UTC](https://www.ruby-forum.com/t/very-lost-with-rubygems-and-required-files/58012 "2006-04-17T18:57:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dirk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/87869e/32.png) [@dirk](https://www.ruby-forum.com/u/dirk)\
**Post date:** [April 17, 2006, 6:57pm UTC](https://www.ruby-forum.com/t/very-lost-with-rubygems-and-required-files/58012/1 "2006-04-17T18:57:14Z")

</div>

hi everyone,  
a few hours ago, i successfully packed my first gem.  
however, my gem uses certain .png images.  
when somebody requires my gem, i want the images to be loaded from /images/  
but as the file that is required is located in /lib/ , the  
images are loaded from …/images/  
how can i setup the gem or the required file, so that the files will be  
loaded from the proper directory?  
greetings, Dirk.

---

<div class="post-metadata">

**Author:** ![dirk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/87869e/32.png) [@dirk](https://www.ruby-forum.com/u/dirk)\
**Post date:** [April 17, 2006, 7:25pm UTC](https://www.ruby-forum.com/t/very-lost-with-rubygems-and-required-files/58012/2 "2006-04-17T19:25:02Z")

</div>

On Tue, 2006-04-18 at 01:56 +0900, Dirk M. wrote:

> hi everyone,  
> a few hours ago, i successfully packed my first gem.  
> however, my gem uses certain .png images.  
> when somebody requires my gem, i want the images to be loaded from /images/  
> but as the file that is required is located in /lib/ , the  
> images are loaded from …/images/  
> how can i setup the gem or the required file, so that the files will be  
> loaded from the proper directory?  
> greetings, Dirk.

Could you use something like:

```
PNGPATH = File.join(File.dirname( __FILE__ ), '../images/')

```

in your main require file?
