Config.datadir in 1.9.1

N

nikolai.weibull

(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?
 
N

nikolai.weibull

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

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,166
Messages
2,570,901
Members
47,442
Latest member
KevinLocki

Latest Threads

Top