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
$ irb -rpp >> require 'ap' # 'ap' is a gem or lib you just installed in the system => true >> pp $LOAD_PATH.first ".../gems/awesome_print-1.0.2/lib"
Note: For Ruby 1.8 you must require ‘rubygems’ before requiring any gems.