Veerasundaravel's Ruby on Rails Weblog

November 23, 2008

Difference between Ruby Gems and Rails Plugins

Filed under: Ruby — Tags: , , , , , , , — Veerasundaravel @ 12:40 pm

Here some quick differentiation between RubyGems and RailsPlugin. They both offer out-of-the-box, third party functionality. While Ruby gems and Rails plugins have similar effects in your application, they obviously vary significantly in their architecture. Ultimately, each will prove more or less useful in a given scenario.

Ruby Gems:

1. Gem is a packaged ruby application using the packaging system defined by RubyGems.
2. Gems are highly portable chunks of Ruby code that can be used inside any Ruby script or application(system wide).
3. Rails itself is a Gem.
4. Easily we can install, upgrade and query gem version.
5. Installation syntax: gem install gem_name.

Rails Plugin:

1. Plugin is an extension of Rails Framework.
2. All plugins are loaded from vendor/plugins.
3. Can not be upgraded by using a command. To upgrade one have to uninstall and then install upgraded version.
4. Has to be hooked into rails application. (has to have init.rb)
5. Should have an install.rb file.
6. We can’t use a plugin system wide, can be used application wide only.
7. Installation syntax: ruby script/plugin install plugin_name

Useful references for Gems:

https://rubygems.org/
http://ruby-toolbox.com/

Useful references for Plugins:

http://agilewebdevelopment.com/
https://github.com/rails/

%d bloggers like this: