Jump to content

RubyGems

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by 84.113.183.242 (talk) at 16:37, 22 August 2014. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

RubyGems
Stable release
2.4.1 / July 17, 2014; 10 years ago (2014-07-17)
Repository
Written inRuby
Operating systemCross-platform
TypePackage manager
LicenseRuby License
Websiterubygems.org

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. It is analogous to pip for the Python programming language. RubyGems was created in about November 2003 and is now part of the standard library from Ruby version 1.9.

Gems

Gems are packages similar to Ebuilds. They contain package information along with files to install.

Gems are usually built from ".gemspec" files, which are YAML files containing information on Gems. However, Ruby code may also build Gems directly. Such a practice is usually used with Rake.

gem command

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

gem usage

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

Installation:

gem install mygem

Uninstallation:

gem uninstall mygem

Listing installed gems:

gem list --local

Listing available gems, e.g.:

gem list --remote

Create RDoc documentation for all gems:

gem rdoc --all

Download but do not install a gem:

gem fetch mygem

Search available gems, e.g.:

gem search STRING --remote

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

Complexities in Rubygems

carrierWave
Upload files in your Ruby applications, map them to a range of ORMs, store them on different backends. It works well with Rack based web applications, such as Ruby on Rails.
RMagick
RMagick is an interface between the Ruby programming language and the ImageMagick and GraphicsMagick image processing libraries.
Cancan
CanCan is an authorization library for Ruby on Rails which restricts what resources a given user is allowed to access and is decoupled from user roles. All permissions are stored in a single location and not duplicated across controllers, views, and database queries.
RailsBricks
RailsBricks enables the creation of Ruby on Rails apps much faster by automating mundane setup tasks and configuring useful common gems retrieved from RubyGems.