From: Ken Bloom Date: 2008-01-05T04:40:59+09:00 Subject: Re: [OOT] rubygems: location of my gems On Fri, 04 Jan 2008 13:49:21 -0500, Nasir Khan wrote: > [Note: parts of this message were removed to make it a legal post.] > > Hi, > > Is there an easy way of finding the location of my installed gem > programmatically. > I need this to create an environment variable. > > Thanks > Nasir __FILE__ will tell you the location of the file in which you use it. So when my SqlStatement gem is installed on Debian, the location of sqlstatement.rb is /var/lib/gems/1.8/gems/SqlStatement-1.0.2/lib/ sqlstatement.rb, and I can find other paths in the directory tree by taking them relative to the known location of that file in my directory tree. --Ken -- Ken (Chanoch) Bloom. PhD candidate. Linguistic Cognition Laboratory. Department of Computer Science. Illinois Institute of Technology. http://www.iit.edu/~kbloom1/