Ruby : RubyGems : What does RubyGem do?

  • RubyGems is a package manager for the Ruby programming language that provides a standard format for distributing Ruby programs and libraries (in a self-contained format called a “gem“), a tool designed to easily manage the installation of gems, and a server for distributing them.


RubyGems modifies your Ruby load path, which controls how your Ruby code is found by the require statement. When you require a gem, really you’re just placing that gem’s lib directory onto your $LOAD_PATH.

$ irb -rpp
>> require 'ap'
# 'ap' is a gem or lib you just installed in the system
=> true
>> pp $LOAD_PATH.first

Note: For Ruby 1.8 you must require ‘rubygems’ before requiring any gems.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s