Installing RubyGems

Before you can install any individual gem, you need to install the RubyGems program, called gem. As of Ruby 1.9, RubyGems is automatically included in an installation of Ruby. In earlier versions, you’ll need to install RubyGems separately, as is discussed in the next sequence of steps.

Before attempting to install RubyGems, you should first check if RubyGems isn’t already on your computer, just to be safe. If you used the one-click installer on Windows, RubyGems will be included, and it may be pre-installed on some versions of Mac OS X and Unix/Linux as well. To see if RubyGems is installed, run this command within a command shell (Figure 12.1):

gem -v

Figure 12.1 If RubyGems is already installed, the command gem -v will ...

Get Ruby: Visual Quickstart Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.