# Plugins versus Gems

**URL:** <https://www.ruby-forum.com/t/plugins-versus-gems/145902>\
**Category:** Rails\
**Created:** [August 14, 2008, 9:39pm UTC](https://www.ruby-forum.com/t/plugins-versus-gems/145902 "2008-08-14T21:39:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e19b73/32.png) [@jeff](https://www.ruby-forum.com/u/jeff)\
**Post date:** [August 14, 2008, 9:39pm UTC](https://www.ruby-forum.com/t/plugins-versus-gems/145902/1 "2008-08-14T21:39:52Z")

</div>

Rails 2.1 introduced some nifty ways to manage gems that your Rails  
application depends upon. However, using gems _instead of_ plugins  
seems to a growing practice as well.

I’m just wondering why this is? Installing a plugin means

- plugins are downloaded from a remote source and copied into vendor/  
plugins
- Rails automatically finds code in vendor/plugins

rake gems:install in Rails 2.1 means:

- gems can downloaded from a remote source and “unpacked” (source  
copied) into vendor/gems
- Rails automatically finds code in vendor/gems

What is the rationale for preferring one over the other?

The main advantage I see of gems is finer-grained control over the  
version of the gem you will allow your app to use (a non-issue if you  
unpack anyway).

Thanks,  
Jeff

> **[Hey Daddio!](http://softiesonrails.com)**
>
> Home of Hey Daddio Software

[purpleworkshops.com](http://purpleworkshops.com)

---

<div class="post-metadata">

**Author:** ![jeff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e19b73/32.png) [@jeff](https://www.ruby-forum.com/u/jeff)\
**Post date:** [August 14, 2008, 10:01pm UTC](https://www.ruby-forum.com/t/plugins-versus-gems/145902/2 "2008-08-14T22:01:01Z")

</div>

I have wondered this very same thing so hopefully someone can provide  
some insight into it.

I do however believe that a gem is available system-wide, where a  
plugin is only available to the particular application that it is  
installed in. Is that correct anyone?

–Cory

---

<div class="post-metadata">

**Author:** ![jeff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e19b73/32.png) [@jeff](https://www.ruby-forum.com/u/jeff)\
**Post date:** [August 14, 2008, 10:15pm UTC](https://www.ruby-forum.com/t/plugins-versus-gems/145902/3 "2008-08-14T22:15:40Z")

</div>

On Aug 14, 2:59 pm, CPerry [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I have wondered this very same thing so hopefully someone can provide  
> some insight into it.
> 
> I do however believe that a gem is available system-wide, where a  
> plugin is only available to the particular application that it is  
> installed in. Is that correct anyone?

That is correct, but is a double-edged sword. For the same reason it’s  
best to “freeze” rails to your app so that you’re not dependent on the  
system-wide Rails gems (unexpected upgrades or downgrades), I think  
most people will also “freeze” (unpack) their gems into their app as  
well.

Perhaps the main advantage is to simply have the choice. I can install  
gems once without replication if many apps use the same gems (like  
will\_paginate, pdf-writer, etc.) if I’m willing to rely on system-wide  
gems. Or, I can choose to unpack if I wish.

Whereas with plugins, you could easily do the same by symlinking  
vendor/plugins to a shared directory on your server, but perhaps this  
wasn’t obvious to many people.

Jeff

> **[Hey Daddio!](http://softiesonrails.com)**
>
> Home of Hey Daddio Software

[purpleworkshops.com](http://purpleworkshops.com)

REST with Rails, Oct 4, 2008, Austin, TX:  
[http://www.purpleworkshops.com/workshops/rest-and-web-services](http://www.purpleworkshops.com/workshops/rest-and-web-services)

---

<div class="post-metadata">

**Author:** ![jeff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e19b73/32.png) [@jeff](https://www.ruby-forum.com/u/jeff)\
**Post date:** [August 16, 2008, 3:59pm UTC](https://www.ruby-forum.com/t/plugins-versus-gems/145902/4 "2008-08-16T15:59:12Z")

</div>

Also plugins i believe are only for rails, while gems can be used by  
any ruby application (or framework).

On Aug 15, 8:58 pm, Robert W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![jeff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e19b73/32.png) [@jeff](https://www.ruby-forum.com/u/jeff)\
**Post date:** [August 15, 2008, 7:58pm UTC](https://www.ruby-forum.com/t/plugins-versus-gems/145902/5 "2008-08-15T19:58:22Z")

</div>

There is one advantage that I see with gems over plugins: If I’m away  
from an internet connection working on my application and get to a point  
that I need to use a gem/plugin it’s easier with a gem. I can simply  
vendor it (or just use it). But, unless I have previously downloaded and  
stored a plugin somewhere on my local hard drive, I’m stuck.

Not that it’s is much different than with a gem I might not have, but  
I’m saying the likelihood of having a commonly used gem installed is  
higher than the case for a plugin.

Jeff C. wrote:

> On Aug 14, 2:59ï¿½pm, CPerry [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > I have wondered this very same thing so hopefully someone can provide  
> > some insight into it.
> > 
> > I do however believe that a gem is available system-wide, where a  
> > plugin is only available to the particular application that it is  
> > installed in. Is that correct anyone?
> 
> That is correct, but is a double-edged sword. For the same reason it’s  
> best to “freeze” rails to your app so that you’re not dependent on the  
> system-wide Rails gems (unexpected upgrades or downgrades), I think  
> most people will also “freeze” (unpack) their gems into their app as  
> well.
> 
> Perhaps the main advantage is to simply have the choice. I can install  
> gems once without replication if many apps use the same gems (like  
> will\_paginate, pdf-writer, etc.) if I’m willing to rely on system-wide  
> gems. Or, I can choose to unpack if I wish.
> 
> Whereas with plugins, you could easily do the same by symlinking  
> vendor/plugins to a shared directory on your server, but perhaps this  
> wasn’t obvious to many people.
> 
> Jeff
> 
> [softiesonrails.com](http://softiesonrails.com)  
> [purpleworkshops.com](http://purpleworkshops.com)
> 
> REST with Rails, Oct 4, 2008, Austin, TX:  
> [http://www.purpleworkshops.com/workshops/rest-and-web-services](http://www.purpleworkshops.com/workshops/rest-and-web-services)
