[#25936] [Bug:1.9] [rubygems] $LOAD_PATH includes bin directory — Nobuyoshi Nakada <nobu@...>

Hi,

10 messages 2009/10/05

[#25943] Disabling tainting — Tony Arcieri <tony@...>

Would it make sense to have a flag passed to the interpreter on startup that

16 messages 2009/10/05

[#26028] [Bug #2189] Math.atanh(1) & Math.atanh(-1) should not raise an error — Marc-Andre Lafortune <redmine@...>

Bug #2189: Math.atanh(1) & Math.atanh(-1) should not raise an error

14 messages 2009/10/10

[#26222] [Bug #2250] IO::for_fd() objects' finalization dangerously closes underlying fds — Mike Pomraning <redmine@...>

Bug #2250: IO::for_fd() objects' finalization dangerously closes underlying fds

11 messages 2009/10/22

[#26244] [Bug #2258] Kernel#require inside rb_require() inside rb_protect() inside SysV context fails — Suraj Kurapati <redmine@...>

Bug #2258: Kernel#require inside rb_require() inside rb_protect() inside SysV context fails

24 messages 2009/10/22

[#26361] [Feature #2294] [PATCH] ruby_bind_stack() to embed Ruby in coroutine — Suraj Kurapati <redmine@...>

Feature #2294: [PATCH] ruby_bind_stack() to embed Ruby in coroutine

42 messages 2009/10/27

[#26371] [Bug #2295] segmentation faults — tomer doron <redmine@...>

Bug #2295: segmentation faults

16 messages 2009/10/27

[ruby-core:26220] Re: Config.datadir in 1.9.1

From: Yugui <yugui@...>
Date: 2009-10-22 02:55:00 UTC
List: ruby-core #26220
Hi,

2009/10/21 Nikolai Weibull <now@bitwi.se>:
> In 1.8.6., Config.datadir('package') would give you the gem-relative
> data directory for a gem. 潛n 1.9.1, Config doesn稚 seem to even be
> loaded at startup. 澹hat happened? 澹hat am I supposed to use instead?
> 潸ven if you get Config loaded it still won稚 work, as the gem痴 paths
> are already added to $LOAD_PATH, so Rubygems won稚 load the
> specification and thus Gem.datadir('package') will give a nil result.

First, ::Config is deprecated. You should use RbConfig instead.
::Config is an alias of RbConfig for compatibility to < 1.8.

Second, RbConfig is a bundled library but not a core library. So it is
not loaded by default.
I think it has been loaded by RubyGems when you use RubyGems.

Third, RbConfig.datadir(pkg) is a part of RubyGems but not a part of RbConfig.

So you should write like this:

 require 'rbconfig'
 require 'rbconfig/datadir'

 RbConfig.datadir("blahblahblah")

This works fine for both 1.8 and 1.9.

Thanks,
-- Yuki Sonoda (Yugui)

In This Thread