From: Lee Hinman Date: 2009-06-26T03:15:37+09:00 Subject: Re: Gem development On Thu, Jun 25, 2009 at 12:12 PM, Martin Hess wrote: > When you are developing a gem, and you want to add examples, how do you get > your example to find your gem without installing your gem? > > i.e. suppose you have > > mygem/ >        examples/ >                example1.rb >        lib/ > > and example1.rb starts with >        require "mygem" > > but your gem isn't installed yet so how does example1.rb find the right > code? > > Is there some trick for this, or do people just install their gem first? You can do this to run your example: mygem% ruby -I lib examples/example1.rb The '-I lib' will add 'lib' to the include path for Ruby.