TOTD #6: Difference between Ruby Gem and Rails Plugin
As a newbie to
Rails, "Gem" and "Plugin" terminology
was slightly confusing to me. Specifically I saw the terms being used
interchangeably sometimes. This
TOTD highlights the
difference between Ruby Gem and
Ruby Gem and Plugin are both packaging systems - the main difference is the
scope in which they are effective. The common differences are highlighted in the table
|Definition||A Gem is a packaged Ruby application using the packaging
system defined by RubyGems.
|A Rails plugin is a
packaged Ruby application that extends the core
name (e.g. rake) and a version (e.g. 0.4.16).
Rails is also installed as a Gem.
|Has a name (e.g.
and a version (e.g. 1.1.1).
|Scope||Installed in the Ruby or JRuby installation
and is available to all applications run using that interpreter.
|Installed in a specific Rails app only.|
|Packaging System||Rails gem is installed in
|Goldspike plugin is installed in
directory of the application as:
|Management||Gems are managed on your computer using the
packages using the
|Plugins can be installed using after creating a Rails application and then
invoking the command
directory of your gem to the load path of Ruby.
|Rails adds the
your application's load path.
|Publish Format||A Gem may be published as Plugin, for
|A Plugin cannot be published as Gem.|
Here are some useful entries (with numerous pointers on screencasts, blogs,
tips & extensive feature sets) to get you started with JRuby:
Are there any other main differences that I missed ?
Please leave suggestions on other TOTD that you'd like to see. A complete
archive is available here.