# Re: Full paths of Ruby interpreter and running script

**URL:** <https://www.ruby-forum.com/t/re-full-paths-of-ruby-interpreter-and-running-script/93984>\
**Category:** Ruby\
**Created:** [April 17, 2006, 6:03pm UTC](https://www.ruby-forum.com/t/re-full-paths-of-ruby-interpreter-and-running-script/93984 "2006-04-17T18:03:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![BergerS\_Daniel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bc8723/32.png) [@BergerS\_Daniel](https://www.ruby-forum.com/u/BergerS_Daniel)\
**Post date:** [April 17, 2006, 6:03pm UTC](https://www.ruby-forum.com/t/re-full-paths-of-ruby-interpreter-and-running-script/93984/1 "2006-04-17T18:03:58Z")

</div>

> from within a running program. I want to distribute a program  
> that can be installed in a folder chosen by the user. The  
> program would save configuration information in the same  
> folder. In order to find the configuration file at runtime, I  
> thought I would query the full path of the Ruby interpreter  
> or script file. In case it makes a difference, I’m using Windows.
> 
> Jamal

Is this what you’re after?

require ‘rbconfig’  
include Config

puts CONFIG[‘bindir’] # c:/ruby/bin

Regards,

Dan

---

<div class="post-metadata">

**Author:** ![BergerS\_Daniel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bc8723/32.png) [@BergerS\_Daniel](https://www.ruby-forum.com/u/BergerS_Daniel)\
**Post date:** [April 17, 2006, 6:16pm UTC](https://www.ruby-forum.com/t/re-full-paths-of-ruby-interpreter-and-running-script/93984/2 "2006-04-17T18:16:13Z")

</div>

On Tue, 18 Apr 2006, Berger, Daniel wrote:

> > from within a running program. I want to distribute a program  
> > require ‘rbconfig’  
> > include Config
> 
> puts CONFIG[‘bindir’] # c:/ruby/bin
> 
> Regards,

i use this

c = ::Config::CONFIG  
File::join(c[‘bindir’], c[‘ruby\_install\_name’]) \<\< c[‘EXEEXT’]

cheers.

-a
