[Rubygems-developers] The deprecation of autorequire

Daniel Berger djberg96 at gmail.com
Wed Jan 14 20:35:32 EST 2009

Luis Lavena wrote:


> AFAIK autorequire has been deprecated.
> A good reason will be that under certain circumstances you don't want
> to load the whole library of a gem.
> gem 'rspec', '~> 1.1.10' # allow me to have a code locked to a
> specific mayor.minor safe versions
> require 'spec/expectations'
> with autorequire, the above example would have included 'spec' which
> is big and offer way more stuff that I wanted to integrate (I only
> wanted the expectations).
> As you mention, you need to call #gem to indicate you want the gem
> version over the bundled one.
> The same will apply to Rake, which is bundled with 1.9:
> require 'rubygems'
> gem 'rake'
> require 'rake'
> unless the stdlib cases, you can simply everything to just:
> require 'rubygems'
> require 'ptools'
> And will work, no need to indicate the gem activation at all.
> Did I miss something?

No, for that example you're correct.

I just thought that, as more of the stdlib is bundled separately as a 
gem it may become more of a hassle to have to do 'gem' + 'require'. I 
thought it would still be useful for those authors, but it seems to 
cause more confusion than it's worth.

It can always be revisited/revived again at a later day if necessary.



More information about the Rubygems-developers mailing list