# Gem and stubs

**URL:** <https://www.ruby-forum.com/t/gem-and-stubs/102483>\
**Category:** Ruby\
**Created:** [November 15, 2005, 10:14pm UTC](https://www.ruby-forum.com/t/gem-and-stubs/102483 "2005-11-15T22:14:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ara.t.howard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a8b319/32.png) [@ara.t.howard](https://www.ruby-forum.com/u/ara.t.howard)\
**Post date:** [November 15, 2005, 10:14pm UTC](https://www.ruby-forum.com/t/gem-and-stubs/102483/1 "2005-11-15T22:14:05Z")

</div>

what’s the deal? does it support them or not? the docs are confusing  
on the  
matter, but the latest certainly does not support them by default and  
also no  
longer accepts the --install-stubs option.

-a

---

<div class="post-metadata">

**Author:** ![ara.t.howard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a8b319/32.png) [@ara.t.howard](https://www.ruby-forum.com/u/ara.t.howard)\
**Post date:** [November 17, 2005, 4:42am UTC](https://www.ruby-forum.com/t/gem-and-stubs/102483/2 "2005-11-17T04:42:37Z")

</div>

Ara.T.Howard wrote:

> what’s the deal? does it support them or not? the docs are confusing on the  
> matter, but the latest certainly does not support them by default and also no  
> longer accepts the --install-stubs option.

Library stubs have been unsupported for ages. In fact, when you  
install RubyGems, it looks for any existing library stubs and removes  
them 🙂

When “require” gained the ability to look for libraries in installed  
gems, library stubs were no longer needed or wanted.

Application stubs are a different matter. If a gem includes any  
executables, they are proxied in your “bin” directory whether you like  
it or not. AFAIK, there’s no option to control that.

Gavin

---

<div class="post-metadata">

**Author:** ![ara.t.howard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a8b319/32.png) [@ara.t.howard](https://www.ruby-forum.com/u/ara.t.howard)\
**Post date:** [November 17, 2005, 5:12am UTC](https://www.ruby-forum.com/t/gem-and-stubs/102483/3 "2005-11-17T05:12:45Z")

</div>

On Thu, 17 Nov 2005, Gavin S. wrote:

> Ara.T.Howard wrote:
> 
> > what’s the deal? does it support them or not? the docs are confusing on the  
> > matter, but the latest certainly does not support them by default and also no  
> > longer accepts the --install-stubs option.
> 
> Library stubs have been unsupported for ages. In fact, when you  
> install RubyGems, it looks for any existing library stubs and removes  
> them 🙂

yup. you are quite right. i missed that. they really should be there  
as an  
option though. otherwise this doesn’t work

irb -r postgres # postgres stub is installed

i liked that stubs were totally transparent to user code - they needed  
do a  
‘require “rubygems”’

oh well…

> When “require” gained the ability to look for libraries in installed gems,  
> library stubs were no longer needed or wanted.
> 
> Application stubs are a different matter. If a gem includes any  
> executables, they are proxied in your “bin” directory whether you like it or  
> not. AFAIK, there’s no option to control that.

hmmm. thanks for the insight.

cheers.

-a

---

<div class="post-metadata">

**Author:** ![ara.t.howard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a8b319/32.png) [@ara.t.howard](https://www.ruby-forum.com/u/ara.t.howard)\
**Post date:** [November 18, 2005, 1:55am UTC](https://www.ruby-forum.com/t/gem-and-stubs/102483/4 "2005-11-18T01:55:30Z")

</div>

Ara.T.Howard wrote:

> > Library stubs have been unsupported for ages. In fact, when you  
> > install RubyGems, it looks for any existing library stubs and removes  
> > them 🙂
> 
> yup. you are quite right. i missed that. they really should be there as an  
> option though. otherwise this doesn’t work
> 
> irb -r postgres # postgres stub is installed

Yes, that’s the benefit, but it’s a shallow convenience, at the cost of  
spewing crap in the filesystem.

Why not:

alias irb=“irb -r rubygems”

?

Or a special alias for a postgres-enabled irb if that’s something you  
use often.

Gavin

---

<div class="post-metadata">

**Author:** ![ara.t.howard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a8b319/32.png) [@ara.t.howard](https://www.ruby-forum.com/u/ara.t.howard)\
**Post date:** [November 17, 2005, 7:55pm UTC](https://www.ruby-forum.com/t/gem-and-stubs/102483/5 "2005-11-17T19:55:34Z")

</div>

On Nov 16, 2005, at 7:42 PM, Gavin S. wrote:

> When “require” gained the ability to look for libraries in installed  
> gems, library stubs were no longer needed or wanted.
> 
> Application stubs are a different matter. If a gem includes any  
> executables, they are proxied in your “bin” directory whether you like  
> it or not. AFAIK, there’s no option to control that.

$ gem install --help  
Options:  
-v, --version VERSION Specify version of gem to install  
-l, --local Restrict operations to the  
LOCAL domain (default)  
-r, --remote Restrict operations to the  
REMOTE domain  
-b, --both Allow LOCAL and REMOTE operations  
-i, --install-dir DIR  
-d, --[no-]rdoc Generate RDoc documentation for  
the gem on install  
-f, --[no-]force Force gem to install, bypassing  
dependency checks  
-t, --[no-]test Run unit tests prior to  
installation  
-w, --[no-]wrappers Use bin wrappers for executables  
Not available on dosish platforms  
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
Courtesy the Seattle.rb Rubygems Hackfest
