# Config.datadir in 1.9.1

**URL:** <https://www.ruby-forum.com/t/config-datadir-in-1-9-1/177653>\
**Category:** Ruby\
**Created:** [October 21, 2009, 4:40pm UTC](https://www.ruby-forum.com/t/config-datadir-in-1-9-1/177653 "2009-10-21T16:40:48Z")\
**Posts on this page:** 2\
**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:** [October 21, 2009, 4:40pm UTC](https://www.ruby-forum.com/t/config-datadir-in-1-9-1/177653/1 "2009-10-21T16:40:48Z")

</div>

(Cross-posting this from ruby-core, as this might be a better forum  
for it, depending on what the problem actually is.)

In 1.8.6., Config.datadir(‘package’) would give you the gem-relative  
data directory for a gem. In 1.9.1, Config doesn’t seem to even be  
loaded at startup. What happened? What am I supposed to use instead?  
Even if you get Config loaded it still won’t work, as the gem’s paths  
are already added to $LOAD\_PATH, so Rubygems won’t load the  
specification and thus Gem.datadir(‘package’) will give a nil result.

Is this a bug or am I doing something wrong?

---

<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:** [October 21, 2009, 6:55pm UTC](https://www.ruby-forum.com/t/config-datadir-in-1-9-1/177653/2 "2009-10-21T18:55:27Z")

</div>

On Oct 21, 4:38 pm, “removed\_email\_address@domain.invalid”  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> In 1.8.6., Config.datadir(‘package’) would give you the gem-relative  
> data directory for a gem. In 1.9.1, Config doesn’t seem to even be  
> loaded at startup. What happened? What am I supposed to use instead?  
> Even if you get Config loaded it still won’t work, as the gem’s paths  
> are already added to $LOAD\_PATH, so Rubygems won’t load the  
> specification and thus Gem.datadir(‘package’) will give a nil result.
> 
> Is this a bug or am I doing something wrong?

OK, this is definitely due to a deficiency in Rubygems on 1.9.\*:

[http://rubyforge.org/tracker/index.php?func=detail&aid=22617&group\_id=126&atid=575](http://rubyforge.org/tracker/index.php?func=detail&aid=22617&group_id=126&atid=575)

What amazes me is that this has gone unfixed for nearly a year. I  
don’t think that it’s a trivial problem, but I’m amazed that everyone  
has gotten by without this for such a long time. Am I the only one  
using Config.datadir?
