From: Albert Schlef Date: 2009-12-25T16:00:08+09:00 Subject: Re: How to get a file contained in a gem "lib" directory? I単aki Baz Castillo wrote: > Hi, I've build a gem "mylib" which contains a file called "myfile.xml" > under > "lib/mylib" dir. Let's imagine that depending on the environment it is > stored > (after installed) in: > > /usr/local/lib/ruby1.9/gems/1.9/gems/mylib-1.0.1/lib/mylib/myfile.xml > [...] > How would I get "myfile.xml" for the loaded "mylib" gem version? You can put a method to return it in your mylib.rb: def self.get_xml_pathname File.join(File.dirname(__FILE__), 'mylib.xml') end -- Posted via http://www.ruby-forum.com/.