Unable to locate config file.

Discussion in 'Ruby' started by Ch Ba, Dec 17, 2008.

  1. Ch Ba

    Ch Ba Guest

    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 via http://www.ruby-forum.com/.
     
    Ch Ba, Dec 17, 2008
    #1
    1. Advertising

  2. Ch Ba

    dusty Guest

    On Dec 16, 10:16 pm, Ch Ba <> 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')
     
    dusty, Dec 17, 2008
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Um9uIEphY2tzb24=?=

    Unable to locate IIS 6.0

    =?Utf-8?B?Um9uIEphY2tzb24=?=, Feb 2, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    914
    Keith
    Feb 2, 2004
  2. Andy Fish
    Replies:
    1
    Views:
    9,856
    Andy Fish
    Dec 3, 2003
  3. Asra
    Replies:
    0
    Views:
    1,183
  4. Mannu
    Replies:
    1
    Views:
    4,662
    Robert Klemme
    Feb 12, 2007
  5. =?Utf-8?B?U2VyZ2V5IFBvYmVyZXpvdnNraXk=?=

    Regex - unable to locate ASCII characters

    =?Utf-8?B?U2VyZ2V5IFBvYmVyZXpvdnNraXk=?=, May 13, 2007, in forum: ASP .Net
    Replies:
    6
    Views:
    423
    Alexey Smirnov
    May 14, 2007
Loading...

Share This Page