[Rubygems-developers] request_gem vs. gem

Austin Ziegler halostatue at gmail.com
Thu Mar 8 16:55:54 EST 2007


On 3/8/07, Norman Walsh <ndw at nwalsh.com> wrote:
> Sorry if this is an FAQ. Web searching wasn't fruitful.
> Am I missing something obvious?

Yes. gem doesn't autorequire. Autorequire was thought to be a good
idea, but it turned out to be a mediocre-at-best idea in practice. It
is therefore deprecated.

So:

1. Don't use #require_gem -- that does autorequire and it will be
removed for RubyGems 1.0.
2. Only use #gem when you're trying to fix the gem version to a
specific version. The only time when you want to use #gem without a
version specification is for gems like soap4r, where partial files are
in the standard library but you need to use a wholly different version
than is in the standard library.
3. Just use "require 'fcgi'" or whatever the appropriate require for
the files contained in the gem are.

-austin
-- 
Austin Ziegler * halostatue at gmail.com * http://www.halostatue.ca/
               * austin at halostatue.ca * http://www.halostatue.ca/feed/
               * austin at zieglers.ca


More information about the Rubygems-developers mailing list