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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.