Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a Ruby gem?

Tags:

ruby

gem

People also ask

What does a ruby gem do?

The RubyGems software allows you to easily download, install, and use ruby software packages on your system. The software package is called a “gem” which contains a packaged Ruby application or library. Gems can be used to extend or modify functionality in Ruby applications.

What is Ruby gem made of?

ruby, gemstone composed of transparent red corundum (q.v.), a mineral form of aluminum oxide, Al2O3. Its colour varies from deep cochineal to pale rose red, in some cases with a tinge of purple; the most valued is a pigeon-blood red.

What is special about Ruby gem?

Ruby is distinguished for its bright red color, being the most famed and fabled red gemstone. Beside for its bright color, it is a most desirable gem due to its hardness, durability, luster, and rarity. Transparent rubies of large sizes are even rarer than Diamonds. Ruby is the red variety of the mineral Corundum.


According to RubyGems Wiki - 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.

The gem command is used to build, upload, download, and install Gem packages. Gem Usage

RubyGems is very similar to apt-get, portage, and yum in functionality.

Installation:

gem install mygem

Uninstallation:

gem uninstall mygem

Listing installed gems:

gem list --local

Gem Package Building

The gem command may also be used to build and maintain .gemspec and .gem files.

Build .gem from a .gemspec file:

gem build mygem.gemspec

For more info, refer to RubyGems Manuals.


Here are some nice tutorials :)

http://railscasts.com/episodes/135-making-a-gem
http://railscasts.com/episodes/245-new-gem-with-bundler

A gem is a module/Library that you can install and use in every project on your server. A plugin is a module/Library that you can use inside your project

Indeed, if you make some code what you like to share you can make a gem or plugin of it. You can publish it on for example github.com. You can check the source of the existing gems on github if you like to know how to make a gem as well.