ruby /rubygems

Library packaging and distribution for Ruby.

★ 3,996⑂ 1,981👁 167⑃ 5,994● 3,738▤ 506
RubyNOASSERTIONCreated 2010-04-16rubygems.org/
下载:v4.1.1v4.1.1 ↓4.1.12026-11-25
-1
日增长
+1
周增长
3,996
stars
1,981
forks
167
watchers
5,994
prs
3,738
issues
506
releases

README

RubyGems

RubyGems is a package management framework for Ruby.

A package (also known as a library) contains a set of functionality that can be invoked by a Ruby program, such as reading and parsing an XML file.
We call these packages "gems" and RubyGems is a tool to install, create, manage and load these packages in your Ruby environment.

RubyGems is also a client for RubyGems.org, a public repository of Gems that allows you to publish a Gem
that can be shared and used by other developers. See our guide on publishing a Gem at guides.rubygems.org

 Getting Started

Installing and managing a Gem is done through the gem command. To install a Gem such as [Faraday][faraday]:

bash
gem install faraday


[faraday]: https://github.com/lostisland/faraday?tab=readme-ov-file

RubyGems will download the Faraday Gem from RubyGems.org and install it into your Ruby environment.

Finally, inside your Ruby program, load the Faraday gem and start hacking:

ruby
require 'faraday'
response = Faraday.get('https://rubygems.org')
 do something with response...


For more information about how to use RubyGems, see our RubyGems basics guide at guides.rubygems.org

 Bundler

Bundler makes sure Ruby applications run the same code on every machine. It is developed in this repository and ships with Ruby.

It does this by managing the gems that the application depends on. Given a list of gems, it can automatically download and install those gems, as well as any other gems needed by the gems that are listed. Before installing gems, it checks the versions of every gem to make sure that they are compatible, and can all be loaded at the same time. After the gems have been installed, Bundler can help you update some or all of them when new versions become available. Finally, it records the exact versions that have been installed, so that others can install the exact same gems.

For example, these commands will allow you to use Bundler to manage the rspec gem for your application:

bash
bundle init
bundle add rspec
bundle install
bundle exec rspec


For more information about how to use Bundler, see the guides at guides.rubygems.org

 Requirements

 RubyGems supports Ruby 3.0 or later.

 Installation

RubyGems is already installed in your Ruby environment, you can check the version you have installed by running gem --version in your terminal emulator.

In some cases Ruby & RubyGems may be provided as OS packages. This is not a
recommended way to use Ruby & RubyGems. It's better to use a Ruby Version
Manager, such as rbenv or
chruby. If you still want to use the
version provided by your OS package manager, please also use your OS package
manager to upgrade rubygems, and disregard any other installation instructions
given below.

If you would like to manually install RubyGems:

 Download from https://rubygems.org/pages/download, unpack, and cd into RubyGems' src
 OR clone this repository and cd into the repository

Install RubyGems by running:

    $ ruby setup.rb

For more details

Top issues

Discussions

Latest release

v4.1.1 v4.1.1 2026-11-25
RubyGems

 Enhancements:

 Installs bundler 4.1.1 as a default gem.

 Bug fixes:

 Fix file permissions during gem extraction. Pull request 10128 by Hiroshi SHIBATA
 Resolve chained symlink targets before creating them during extraction. Pull request 10119 by Hiroshi SHIBATA
 Keep negative any terms when PubGrub resolves conflicts. Pull request 10112 by Hiroshi SHIBATA
 Serialize concurrent installs of the same gem. Pull request 10107 by Hiroshi SHIBATA
 Keep resolved prereleases when sorting install requests. Pull request 10100 by Hiroshi SHIBATA
 Forward keyword arguments in the IPv4 fallbac

Snapshot: 2026-11-28T10:06:57Z · Data license Apache-2.0 · JSON