1. Introduction to RubyGems

Question: I\’ve installed RubyGems and I want to install Rails (for example). How do I do that?

Answer:

gem install rails

And then answer Y when asked about installing dependencies.

A gem is a packaged Ruby application or library. It has a name (e.g. rake) and a version (e.g. 0.4.16).

Gems are managed on your computer using the gem command. You can install, remove, and query (amoung other things) gem packages using the gem command.

RubyGems is the name of the project that developed the gem packaging system and the gem command. You can get RubyGems from the RubyForge repository.

This document demonstrates the the use of the most important features of RubyGems in a quick and high-level way. It is designed to be read all the way through to give the reader a feeling for this technology. More detailed information is available in the gem command reference.

RubyGems Features

  • Easy Installation and removal of RubyGems packages and their dependents.
  • Management and control of local packages
  • Package dependency management
  • Query, search and list local and remote packages
  • Multiple version support for installed packages
  • Web-based interface to view the documentation for your installed gems
  • Easy to use interface for building gem packages
  • Simple server for distributing your own gem packages

RubyGems Benefits

Using RubyGems, you can:
  • download and install Ruby libraries easily
  • not worry about libraries A and B depending on different versions of library C
  • easily remove libraries you no longer use
  • have power and control over your Ruby platform!

It’s the way it should be.