Forum: Ruby Unable to locate config file.

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
F3be80254c63fb37ccb1bfc5a3794d1b?d=identicon&s=25 Ch Ba (navouri)
on 2008-12-17 04:23
 I have a gemmed command line utility that requires a configuration
file. The configuration file is included in the gem and installs in the
base directory. A file in /lib needs to load it, but I am unable to do
so. Calling '../config.yml' does not locate it, nor does anything else
I've tried so far as the current directory is just wherever the command
line utility is being run from. How can I locate this configuration file
in a friendly os independent way?
2e8848a777f7165f80da876ab1e6e7e5?d=identicon&s=25 dusty (Guest)
on 2008-12-17 07:00
(Received via mailing list)
On Dec 16, 10:16 pm, Ch Ba <navo...@gmail.com> wrote:
>  I have a gemmed command line utility that requires a configuration
> file. The configuration file is included in the gem and installs in the
> base directory. A file in /lib needs to load it, but I am unable to do
> so. Calling '../config.yml' does not locate it, nor does anything else
> I've tried so far as the current directory is just wherever the command
> line utility is being run from. How can I locate this configuration file
> in a friendly os independent way?
> --
> Posted viahttp://www.ruby-forum.com/.

Try

File.join(File.dirname(__FILE__),'..','config.yml')
This topic is locked and can not be replied to.