From: Wes Gamble Date: 2006-03-24T05:26:28+09:00 Subject: Re: What is the point of require_gem in Ruby 1.8.2? Jim, So I think the question still stands. Is require_gem only do the version checking? What does it mean to "activate" a Gem? Wes Jim Weirich wrote: > Wes Gamble wrote: >> I just went through this mess over the last few hours... >> >> http://www.ruby-forum.com/topic/59185 >> >> If I do: >> >> require_gem 'gemname', '>= version' >> >> I discovered that require_gem doesn't actually do the "require" call on >> the 1st argument. > > That's because the first argument is the name of the Gem to be > activated, not the name of a file to be required. > > However, many gems have the same name as their main require file, so > there is a lot of confusion. Also some gems have an 'autorequire' flag > set that /will/ do a require on the main file. > > And to futher the confussion, the command name 'require_gem' was poorly > selected. Future versions of RubyGems will provide a better named > command for this operation. > >> So what's the point of require_gem then? > > If you have multiple versions of a gem installed, the require_gem > command specifies what version of the gem you are willing to use. If > you don't care what version will be used, and just want the latest > version of whatever is installed, then there is no reason to even bother > with the require_gem command. > > -- > -- Jim Weirich -- Posted via http://www.ruby-forum.com/.