Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
Unable to locate config file.
Chris Bailey
12/17/2008 3:16:00 AM
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-...
.
1 Answer
dusty
12/17/2008 5:59:00 AM
0
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 via
http://www.ruby-...
.
Try
File.join(File.dirname(__FILE__),'..','config.yml')
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Unable to locate config file.
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password