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.

REQUIRING CODE

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
".../gems/awesome_print-1.0.2/lib"

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

sources:

http://guides.rubygems.org/rubygems-basics/#requiring-code

en.wikipedia.org/wiki/RubyGems

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s