|| Ruby Gem
|| Rails Plugin
||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 Rails framework.
||Has a name (e.g. rake) and a version (e.g. 0.4.16). Rails is also installed as a Gem.
||Has a name (e.g. Goldspike) and a version (e.g. 1.1.1).
||Installed in the Ruby or JRuby installation and is available to all applications run using that interpreter.
||Installed in a specific Rails app only.
||Rails gem is installed in
lib directory contains all the gem source code.
|Goldspike plugin is installed in
vendor\plugins\rails-integration directory of the application as:
plugins/goldspike directory consists of
lib directory contains all the plugin source code.
||Gems are managed on your computer using the
gem command. You can install, remove and query gem packages using the
|Plugins can be installed using after creating a Rails application and then invoking the command
ruby script\plugin install [url or name of plugin]
gem command adds the
lib directory of your gem to the load path of Ruby.
|Rails adds the
lib directory of plugin in your application’s load path.
- Bundled Rake tasks that get automatically loaded into your Rakefile
- An installation hook (install.rb)
- An application initialization hook for the plugin to inject itself (init.rb)
- ability to bundle additional generators (for the script/generate script)