Go to main content

man pages section 1: User Commands

Exit Print View

Updated: Wednesday, February 9, 2022

gem (1)


gem - line interface to RubyGems


gem -h|--help

gem -v|--version

gem command [ arguments... ] [ options... ]


gem(1)                                                                  gem(1)

       gem  --  Command-line interface to RubyGems

       gem -h|--help

       gem -v|--version

       gem command [ arguments... ] [ options... ]

       A  gem is a packaged Ruby application or library, while RubyGems is the
       premier ruby packaging system which is used to manage gems.

       Gems are managed on your  computer  using  the  gem  command.  You  can
       install, remove, and query gem packages using the gem command.

       *  Easy  Installation and removal of RubyGems packages and their depen-

       * Management and control of local packages

       * Package dependency management

       * Query, search and list local and remote packages

       * Multiple version support for installed packages

       * Web-based interface to view the documentation for your installed gems

       * Easy to use interface for building gem packages

       * Simple server for distributing your own gem packages

       -h | --help
              Get the basic help message for gem command.

       -v | --version
              Get the version of gem command.


              build           Build a gem from a gemspec

              cert            Manage RubyGems certificates  and  signing  set-

              check           Check  a  gem  repository  for  added or missing

              cleanup         Clean up old versions of installed gems

              contents        Display the contents of the installed gems

              dependency      Show the dependencies of an installed gem

              environment     Display information about the RubyGems  environ-

              fetch           Download  a  gem  and  place  it  in the current

              generate_index  Generates the  index  files  for  a  gem  server

              help            Provide help on the 'gem' command

              install         Install a gem into the local repository

              list            Display local gems whose name matches REGEXP

              lock            Generate a lockdown list of gems

              mirror          Mirror all gem files (requires rubygems-mirror)

              open            Open gem sources in editor

              outdated        Display all gems that need updates

              owner           Manage gem owners of a gem on the push server

              pristine        Restores  installed  gems  to pristine condition
                              from files located in the gem cache

              push            Push a gem up to the gem server

              query           Query gem information in local or remote reposi-

              rdoc            Generates RDoc for pre-installed gems

              search          Display remote gems whose name matches REGEXP

              server          Documentation and gem repository HTTP server

              sources         Manage  the sources and cache file RubyGems will
                              search for gems

              specification   Display gem specification (in yaml)

              stale           List gems along with access times

              uninstall       Uninstall gems from the local repository

              unpack          Unpack an installed gem to the current directory

              update          Update installed gems to the latest version

              which           Find the location of  a  library  file  you  can

              yank            Remove a pushed gem from the index

              For  more  detailed  help on a particular command with its argu-
              ments and options, use 'gem help command '.

              For example:

                      # gem help install

              Commands may be abbreviated, so long as  they  are  unambiguous.
              e.g. 'gem i thor' is short for 'gem install thor'.

              Directory containing the master gem repository.

              Path  list  of  directories  containing  gem  repositories to be
              searched in addition to the GEM_HOME directory. The list  should
              be delimited by the appropriate path separator ':'

       http_proxy / HTTP_PROXY
              URL  of  the  HTTP  protocol  proxy to be used to get out of the
              firewall. The lower case version will be used first.

       MAKE / make
              Name of the make program that should be  used  to  build  exten-

       HOME   Home directory of the user (see below).

       Example 1: Install 'thor', either from local directory or remote server

            # gem install thor

       Example 2: Install 'thor', only from remote server

            # gem install thor --remote

       Example 3: Install 'thor' from remote server and generate documentation

            # gem install thor --remote --document

       Example  4:  Install 'thor', but only version 0.18.1, even if dependen-
       cies are not met, and into a specific directory

            # gem install thor --version 0.18.1 --force --install-dir $HOME/.gem/ruby/2.6.0

       Example 5: List local gems whose name begins with 'r'

            # gem list ^r

       Example 6: List local and remote gems whose name contains 'log'

            # gem search log --both

       Example 7:  List only remote gems whose name contains 'log'

            # gem search log --remote

       Example 8: Uninstall 'thor'

            #  gem uninstall thor

       Example 9:  See information about RubyGems

            # gem environment

       See attributes(7) for descriptions of the following attributes:

       |Availability   | runtime/ruby-26  |
       |Stability      | Uncommitted      |


       The following files specify the installation  locations  for Ruby:

              Default installation location for Ruby gems

              Per user location to install gems. This is  automatically  added
              to GEM_PATH.

              Location of gems installed by Solaris packages.

              Per user location for gem executables.

              Contains  the  Rubygems program with all other Ruby related pro-
              grams.  These programs are linked from /usr/bin.   For  example:
              /usr/ruby/2.6/bin/gem  is linked from /usr/bin/gem26, and may be
              linked from /usr/bin/gem if the package mediator "ruby" is  ver-
              sion  "2.6"  (see  pkg(1)).   Also  contains executables for any
              installed gems that supply them (i.e.: thor, rails, etc).

       Detailed    documentation    for    RubyGems    is     available     at

       Source  code  for open source software components in Oracle Solaris can
       be found at https://www.oracle.com/downloads/opensource/solaris-source-

       This     software     was    built    from    source    available    at
       https://github.com/oracle/solaris-userland.   The  original   community
       source        was       downloaded       from        http://cache.ruby-

       Further information about this software can be found on the open source
       community website at http://www.ruby-lang.org/.

                                26 October 2016                         gem(1)