The Ruby Gem command is detailed

Source: Internet
Author: User

Transferred from:

Gem Introduction:

Gem is a standard package for managing Ruby libraries and programs, and it is easy to find, install, upgrade, and uninstall packages through Ruby Gems such as

Ruby 1.9. Version 2 has the Ruby Gem installed by default, and if you are using a different distribution, see "How to Install Ruby Gem".

How to install the Ruby gem package:

All gem packages will be installed into the/[ruby root]/lib/ruby/gems/[ver]/directory, which includes the cache, doc, gems, specifications 4 directories, the cache is placed under the download of the native gem package, The gems is placed under the extracted gem package.
When problems are encountered during installation, you can go to these directories, manually delete the problematic gem package, and then rerun the gem install [gemname] command.

The Ruby Gem command is detailed:

Update Gem itself
Note: This command disables execution for system stability in some Linux distributions
$ gem Update--system

Install the gem package from the Gem source
$ gem install [Gemname]

Install the gem package from native
$ Gem install-l [Gemname].gem

Install the specified version of the gem package
$ gem install [gemname]--version=[ver]

Update all installed gem packs
$ gem Update

Update the specified GEM package
Note: Gem Update [gemname] does not upgrade an older version of the package, you can use the gem install [gemname]--version=[ver] instead
$ gem Update [Gemname]

Delete the specified gem package, note that this command will remove all installed versions
$ gem Uninstall [Gemname]

Delete a specified version of the gem
$ gem Uninstall [Gemname]--version=[ver]

View all the gem packages that are installed on this computer
$ gem list [--local]

Wen/mklaus (author of Jane's book)
Original link:
Copyright belongs to the author, please contact the author to obtain authorization, and Mark "book author".

The Ruby Gem command is detailed

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.