From: Jason Roelofs Date: 2007-01-06T03:57:22+09:00 Subject: Re: A 'require' question ------=_Part_32010_10925666.1168022835568 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline require_gem 'gem_name', '>=1.2.3' Though newest version of gems now has just gem 'gem_name', '>=1.2.3' Jason On 1/5/07, bbiker wrote: > > When you have multiple versions of a gem, "require 'gemxxx'" loads in > the latest version. > > How can you specify a specific version (or some other constraint)? > > The ri documentation for require is of no help. > > --------------------------------------------------------- > Kernel#require > require(string) => true or false > ------------------------------------------------------------------------ > Ruby tries to load the library named _string_, returning +true+ if > successful. If the filename does not resolve to an absolute path, > it will be searched for in the directories listed in +$:+. If the > file has the extension ``.rb'', it is loaded as a source file; if > the extension is ``.so'', ``.o'', or ``.dll'', or whatever the > default shared library extension is on the current platform, Ruby > loads the shared library as a Ruby extension. Otherwise, Ruby tries > adding ``.rb'', ``.so'', and so on to the name. The name of the > loaded feature is added to the array in +$"+. A feature will not be > loaded if it's name already appears in +$"+. However, the file name > is not converted to an absolute path, so that ``+require > 'a';require './a'+'' will load +a.rb+ twice. > > require "my-library.rb" > require "db-driver" > > > ------=_Part_32010_10925666.1168022835568--