This is a user sandbox of Alfredo702. You can use it for testing or practicing edits. This is not the sandbox where you should draft your assigned article for a dashboard.wikiedu.org course. To find the right sandbox for your assignment, visit your Dashboard course page and follow the Sandbox Draft link for your assigned article in the My Articles section. |
Initial release | March 14, 2004 |
---|---|
Stable release | 2.6.6
/ June 22, 2016 |
Written in | Ruby |
Operating system | Cross-platform |
Type | Package manager |
License | Ruby License |
Website | rubygems |
This article contains instructions, advice, or how-to content. (May 2015) |
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 interface for RubyGems is a command-line tool called gem which can install libraries and manage RubyGems.[1] RubyGems integrates with Ruby run-time loader to help find and load installed gems from standardized library folders.Though it is possible to use a private RubyGems repository, the public repository is most commonly used for gem management. There are about 123,000 gems in the public repository with over 9.8 billion downloads.[2]
The public repository helps users find gems, resolve dependencies and install them. RubyGems is bundled with the standard Ruby package as of Ruby 1.9.
History
editDevelopment on RubyGems started in November 2003 and was released to the public on March 14, 2004, or Pi Day 2004[3]. In 2010, the default public repository for gems moved from http://gems.rubyforge.org to http://rubygems.org, which is still in use. RubyGems development was moved to GitHub. Though RubyGems has existed since Ruby 1.8, it was not part of the standard Ruby distribution until Ruby 1.9.
Previously, compatibility with RubyGems and Ruby varied. Many versions of RubyGems are almost fully incompatible with many versions of Ruby and some versions had key features unusable. For example, Ruby 1.9 came with RubyGems 1.3.7 in its standard distribution, but RubyGems 1.4.x was not compatible with Ruby 1.9. This meant that updating RubyGems on Ruby 1.9 was not possible until RubyGems 1.5.0 was released in 2011, two years after the first stable release of Ruby 1.9[4]. These compatibility issues led to a rapid development of RubyGems, switching to a 4-6 week release schedule. This is reflected in there being 38 releases from 2004-2010 and 117 releases from 2011-2016. 45 versions were released in 2013, which is the highest number of releases in a year for RubyGems.[3]
Gems
editGems 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
edit
The gem
command is used to build, upload, download, and install Gem packages.
gem
usage
edit
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
edit
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
See also
editExternal links
edit- Official Rubygems project page, including downloads
- Official documentation of the Rubygems tool
- Linux Journal article
Category:Free software programmed in Ruby
Category:Free package management systems
Category:Ruby (programming language)
- ^ "RubyGems Command Reference". guides.rubygems.org. Retrieved 2016-09-14.
- ^ "RubyGems.org Statistics Page". rubygems.org. Retrieved 2016-09-14.
- ^ a b "Version history of RubyGems". GitHub. Retrieved 2016-09-14.
- ^ "Ruby 1.9.1 released". www.ruby-lang.org. Retrieved 2016-09-14.