Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 5fadaf21b3
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 1353 lines (780 sloc) 44.832 kb
layout title previous next
default
Command Reference
/patterns
/rubygems-org-api

What each gem command does, and how to use it.

gem build

Build a gem from a gemspec

Usage

gem build GEMSPEC_FILE [options]

Common Options:

  • -h, -​-help - Get help on this command
  • -V, -​-[no-]verbose - Set the verbose level of output
  • -q, -​-quiet - Silence commands
  • -​-config-file FILE - Use this config file instead of default
  • -​-backtrace - Show stack backtrace on errors
  • -​-debug - Turn on Ruby debugging

Arguments

  • GEMSPEC_FILE - gemspec file name to build a gem for

gem cert

Manage RubyGems certificates and signing settings

Usage

gem cert [options]

Options:

  • -a, -​-add CERT - Add a trusted certificate.
  • -l, -​-list - List trusted certificates.
  • -r, -​-remove STRING - Remove trusted certificates containing STRING.
  • -b, -​-build EMAIL_ADDR - Build private key and self-signed certificate for EMAIL_ADDR.
  • -C, -​-certificate CERT - Certificate for -​-sign command.
  • -K, -​-private-key KEY - Private key for -​-sign command.
  • -s, -​-sign NEWCERT - Sign a certificate with my key and certificate.

Common Options:

  • -h, -​-help - Get help on this command
  • -V, -​-[no-]verbose - Set the verbose level of output
  • -q, -​-quiet - Silence commands
  • -​-config-file FILE - Use this config file instead of default
  • -​-backtrace - Show stack backtrace on errors
  • -​-debug - Turn on Ruby debugging

gem check

Check installed gems

Usage

gem check [options]

Options:

  • -​-verify FILE - Verify gem file against its internal checksum
  • -a, -​-alien - Report 'unmanaged' or rogue files in the gem repository
  • -v, -​-version VERSION - Specify version of gem to check

Common Options:

  • -h, -​-help - Get help on this command
  • -V, -​-[no-]verbose - Set the verbose level of output
  • -q, -​-quiet - Silence commands
  • -​-config-file FILE - Use this config file instead of default
  • -​-backtrace - Show stack backtrace on errors
  • -​-debug - Turn on Ruby debugging

gem cleanup

Clean up old versions of installed gems in the local repository

Usage

gem cleanup [GEMNAME ...] [options]

Options:

  • - -d, -​-dryrun

Common Options:

  • -h, -​-help - Get help on this command
  • -V, -​-[no-]verbose - Set the verbose level of output
  • -q, -​-quiet - Silence commands
  • -​-config-file FILE - Use this config file instead of default
  • -​-backtrace - Show stack backtrace on errors
  • -​-debug - Turn on Ruby debugging

Arguments

  • GEMNAME - name of gem to cleanup

Description

The cleanup command removes old gems from GEM_HOME. If an older version is installed elsewhere in GEM_PATH the cleanup command won't touch it.

gem contents

Display the contents of the installed gems

Usage

gem contents GEMNAME [GEMNAME ...] [options]

Options:

  • -v, -​-version VERSION - Specify version of gem to contents
  • -​-all - Contents for all gems
  • -s, -​-spec-dir a,b,c - Search for gems under specific paths
  • -l, -​-[no-]lib-only - Only return files in the Gem's lib_dirs
  • -​-[no-]prefix - Don't include installed path prefix

Common Options:

  • -h, -​-help - Get help on this command
  • -V, -​-[no-]verbose - Set the verbose level of output
  • -q, -​-quiet - Silence commands
  • -​-config-file FILE - Use this config file instead of default
  • -​-backtrace - Show stack backtrace on errors
  • -​-debug - Turn on Ruby debugging

Arguments

  • GEMNAME - name of gem to list contents for

gem dependency

Show the dependencies of an installed gem

Usage

gem dependency GEMNAME [options]

Options:

  • -v, -​-version VERSION - Specify version of gem to dependency
  • -​-platform PLATFORM - Specify the platform of gem to dependency
  • -​-[no-]prerelease - Allow prerelease versions of a gem
  • - -R, -​-[no-]reverse-dependencies Include reverse dependencies in the output
  • -​-pipe - Pipe Format (name -​-version ver)

Deprecated Options:

  • -u, -​-[no-]update-sources - Update local source cache

Local/Remote Options:

  • -l, -​-local - Restrict operations to the LOCAL domain
  • -r, -​-remote - Restrict operations to the REMOTE domain
  • -b, -​-both - Allow LOCAL and REMOTE operations
  • -B, -​-bulk-threshold COUNT - Threshold for switching to bulk synchronization (default 1000)
  • -​-clear-sources - Clear the gem sources
  • -​-source URL - Add URL as a remote source for gems
  • -p, -​-[no-]http-proxy [URL] - Use HTTP proxy for remote operations

Common Options:

  • -h, -​-help - Get help on this command
  • -V, -​-[no-]verbose - Set the verbose level of output
  • -q, -​-quiet - Silence commands
  • -​-config-file FILE - Use this config file instead of default
  • -​-backtrace - Show stack backtrace on errors
  • -​-debug - Turn on Ruby debugging

Arguments

  • GEMNAME - name of gem to show dependencies for

gem environment

Display information about the RubyGems environment

Usage

gem environment [arg] [options]

Common Options:

  • -h, -​-help - Get help on this command
  • -V, -​-[no-]verbose - Set the verbose level of output
  • -q, -​-quiet - Silence commands
  • -​-config-file FILE - Use this config file instead of default
  • -​-backtrace - Show stack backtrace on errors
  • -​-debug - Turn on Ruby debugging

Arguments

  • packageversion - display the package version
  • gemdir - display the path where gems are installed
  • gempath - display path used to search for gems
  • version - display the gem format version
  • remotesources - display the remote gem servers
  • platform - display the supported gem platforms
  • <omitted> - display everything

Description

The RubyGems environment can be controlled through command line arguments, gemrc files, environment variables and built-in defaults.

Command line argument defaults and some RubyGems defaults can be set in ~/.gemrc file for individual users and a /etc/gemrc for all users. A gemrc is a YAML file with the following YAML keys:

:sources: A YAML array of remote gem repositories to install gems from
:verbose: Verbosity of the gem command.  false, true, and :really are the
          levels
:update_sources: Enable/disable automatic updating of repository metadata
:backtrace: Print backtrace when RubyGems encounters an error
:gempath: The paths in which to look for gems
gem_command: A string containing arguments for the specified gem command

Example:

:verbose: false
install: --no-wrappers
update: --no-wrappers

RubyGems' default local repository can be overridden with the GEM_PATH and GEM_HOME environment variables. GEM_HOME sets the default repository to install into. GEM_PATH allows multiple local repositories to be searched for gems.

If you are behind a proxy server, RubyGems uses the HTTP_PROXY, HTTP_PROXY_USER and HTTP_PROXY_PASS environment variables to discover the proxy server.

If you are packaging RubyGems all of RubyGems' defaults are in lib/rubygems/defaults.rb. You may override these in lib/rubygems/defaults/operating_system.rb

gem fetch

Download a gem and place it in the current directory

Usage

gem fetch GEMNAME [GEMNAME ...] [options]

Options:

  • -v, -​-version VERSION - Specify version of gem to fetch
  • -​-platform PLATFORM - Specify the platform of gem to fetch
  • -​-[no-]prerelease - Allow prerelease versions of a gem

Local/Remote Options:

  • -B, -​-bulk-threshold COUNT - Threshold for switching to bulk synchronization (default 1000)
  • -p, -​-[no-]http-proxy [URL] - Use HTTP proxy for remote operations
  • -​-source URL - Add URL as a remote source for gems

Common Options:

  • -h, -​-help - Get help on this command
  • -V, -​-[no-]verbose - Set the verbose level of output
  • -q, -​-quiet - Silence commands
  • -​-config-file FILE - Use this config file instead of default
  • -​-backtrace - Show stack backtrace on errors
  • -​-debug - Turn on Ruby debugging

Arguments

  • GEMNAME - name of gem to download

gem generate_index

Generates the index files for a gem server directory

Usage

gem generate_index [options]

Options:

  • -d, -​-directory=DIRNAME - repository base dir containing gems subdir
  • -​-[no-]legacy - Generate Marshal.4.8
  • -​-[no-]modern - Generate indexes for RubyGems newer than 1.2.0
  • -​-update - Update modern indexes with gems added since the last update

RSS Options:

  • -​-rss-gems-host=GEM_HOST - Host name where gems are served from, used for GUID and enclosure values
  • -​-rss-host=HOST - Host name for more gems information, used for RSS feed link
  • -​-rss-title=TITLE - Set title for RSS feed

Common Options:

  • -h, -​-help - Get help on this command
  • -V, -​-[no-]verbose - Set the verbose level of output
  • -q, -​-quiet - Silence commands
  • -​-config-file FILE - Use this config file instead of default
  • -​-backtrace - Show stack backtrace on errors
  • -​-debug - Turn on Ruby debugging

Description

The generate_index command creates a set of indexes for serving gems statically. The command expects a 'gems' directory under the path given to the --directory option. The given directory will be the directory you serve as the gem repository.

For gem generate_index --directory /path/to/repo, expose /path/to/repo via your HTTP server configuration (not /path/to/repo/gems).

When done, it will generate a set of files like this:

gems/*.gem                                   # .gem files you want to
                                             # index

specs.<version>.gz                           # specs index
latest_specs.<version>.gz                    # latest specs index
prerelease_specs.<version>.gz                # prerelease specs index
quick/Marshal.<version>/<gemname>.gemspec.rz # Marshal quick index file

# these files support legacy RubyGems
Marshal.<version>
Marshal.<version>.Z                          # Marshal full index

The .Z and .rz extension files are compressed with the inflate algorithm. The Marshal version number comes from ruby's Marshal::MAJOR_VERSION and Marshal::MINOR_VERSION constants. It is used to ensure compatibility.

If --rss-host and --rss-gem-host are given an RSS feed will be generated at index.rss containing gems released in the last two days.

gem help

Provide help on the 'gem' command

Usage

gem help ARGUMENT [options]

Common Options:

  • -h, -​-help - Get help on this command
  • -V, -​-[no-]verbose - Set the verbose level of output
  • -q, -​-quiet - Silence commands
  • -​-config-file FILE - Use this config file instead of default
  • -​-backtrace - Show stack backtrace on errors
  • -​-debug - Turn on Ruby debugging

Arguments

  • commands - List all 'gem' commands
  • examples - Show examples of 'gem' usage
  • <command> - Show specific help for <command>

gem install

Install a gem into the local repository

Usage

gem install GEMNAME [GEMNAME ...] [options] -- --build-flags [options]

Options:

  • -​-platform PLATFORM - Specify the platform of gem to install
  • -v, -​-version VERSION - Specify version of gem to install
  • -​-[no-]prerelease - Allow prerelease versions of a gem to be installed. (Only for listed gems)

Deprecated Options:

  • -u, -​-[no-]update-sources - Update local source cache

Install/Update Options:

  • -i, -​-install-dir DIR - Gem repository directory to get installed gems
  • -n, -​-bindir DIR - Directory where binary files are located
  • -d, -​-[no-]rdoc - Generate RDoc documentation for the gem on install
  • -​-[no-]ri - Generate RI documentation for the gem on install
  • -E, -​-[no-]env-shebang - Rewrite the shebang line on installed scripts to use /usr/bin/env
  • -f, -​-[no-]force - Force gem to install, bypassing dependency checks
  • -w, -​-[no-]wrappers - Use bin wrappers for executables Not available on dosish platforms
  • -P, -​-trust-policy POLICY - Specify gem trust policy
  • -​-ignore-dependencies - Do not install any required dependent gems
  • -y, -​-include-dependencies - Unconditionally install the required dependent gems
  • -​-[no-]format-executable - Make installed executable names match ruby. If ruby is ruby18, foo_exec will be foo_exec18
  • -​-[no-]user-install - Install in user's home directory instead of GEM_HOME.
  • -​-development - Install any additional development dependencies
  • -​-conservative - Don't attempt to upgrade gems already meeting version requirement

Local/Remote Options:

  • -l, -​-local - Restrict operations to the LOCAL domain
  • -r, -​-remote - Restrict operations to the REMOTE domain
  • -b, -​-both - Allow LOCAL and REMOTE operations
  • -B, -​-bulk-threshold COUNT - Threshold for switching to bulk synchronization (default 1000)
  • -​-clear-sources - Clear the gem sources
  • -​-source URL - Add URL as a remote source for gems
  • -p, -​-[no-]http-proxy [URL] - Use HTTP proxy for remote operations

Common Options:

  • -h, -​-help - Get help on this command
  • -V, -​-[no-]verbose - Set the verbose level of output
  • -q, -​-quiet - Silence commands
  • -​-config-file FILE - Use this config file instead of default
  • -​-backtrace - Show stack backtrace on errors
  • -​-debug - Turn on Ruby debugging

Arguments

  • GEMNAME - name of gem to install

Description

The install command installs local or remote gem into a gem repository.

For gems with executables ruby installs a wrapper file into the executable directory by default. This can be overridden with the --no-wrappers option. The wrapper allows you to choose among alternate gem versions using version.

For example rake _0.7.3_ --version will run rake version 0.7.3 if a newer version is also installed.

If an extension fails to compile during gem installation the gem specification is not written out, but the gem remains unpacked in the repository. You may need to specify the path to the library's headers and libraries to continue. You can do this by adding a -- between RubyGems' options and the extension's build options:

$ gem install some_extension_gem
[build fails]
Gem files will remain installed in \
/path/to/gems/some_extension_gem-1.0 for inspection.
Results logged to /path/to/gems/some_extension_gem-1.0/gem_make.out
$ gem install some_extension_gem -- --with-extension-lib=/path/to/lib
[build succeeds]
$ gem list some_extension_gem

*** LOCAL GEMS ***

some_extension_gem (1.0)
$

If you correct the compilation errors by editing the gem files you will need to write the specification by hand. For example:

$ gem install some_extension_gem
[build fails]
Gem files will remain installed in \
/path/to/gems/some_extension_gem-1.0 for inspection.
Results logged to /path/to/gems/some_extension_gem-1.0/gem_make.out
$ [cd /path/to/gems/some_extension_gem-1.0]
$ [edit files or what-have-you and run make]
$ gem spec ../../cache/some_extension_gem-1.0.gem --ruby > \
           ../../specifications/some_extension_gem-1.0.gemspec
$ gem list some_extension_gem

*** LOCAL GEMS ***

some_extension_gem (1.0)
$

gem list

Display gems whose name starts with STRING

Usage

gem list [STRING] [options]

Options:

  • -i, -​-[no-]installed - Check for installed gem
  • -v, -​-version VERSION - Specify version of gem to list for use with -​-installed
  • -d, -​-[no-]details - Display detailed information of gem(s)
  • -​-[no-]versions - Display only gem names
  • -a, -​-all - Display all gem versions
  • -​-[no-]prerelease - Display prerelease versions

Deprecated Options:

  • -u, -​-[no-]update-sources - Update local source cache

Local/Remote Options:

  • -l, -​-local - Restrict operations to the LOCAL domain
  • -r, -​-remote - Restrict operations to the REMOTE domain
  • -b, -​-both - Allow LOCAL and REMOTE operations
  • -B, -​-bulk-threshold COUNT - Threshold for switching to bulk synchronization (default 1000)
  • -​-clear-sources - Clear the gem sources
  • -​-source URL - Add URL as a remote source for gems
  • -p, -​-[no-]http-proxy [URL] - Use HTTP proxy for remote operations

Common Options:

  • -h, -​-help - Get help on this command
  • -V, -​-[no-]verbose - Set the verbose level of output
  • -q, -​-quiet - Silence commands
  • -​-config-file FILE - Use this config file instead of default
  • -​-backtrace - Show stack backtrace on errors
  • -​-debug - Turn on Ruby debugging

Arguments

  • STRING - start of gem name to look for

gem lock

Generate a lockdown list of gems

Usage

gem lock GEMNAME-VERSION [GEMNAME-VERSION ...] [options]

Options:

  • -s, -​-[no-]strict - fail if unable to satisfy a dependency

Common Options:

  • -h, -​-help - Get help on this command
  • -V, -​-[no-]verbose - Set the verbose level of output
  • -q, -​-quiet - Silence commands
  • -​-config-file FILE - Use this config file instead of default
  • -​-backtrace - Show stack backtrace on errors
  • -​-debug - Turn on Ruby debugging

Arguments

  • GEMNAME - name of gem to lock
  • VERSION - version of gem to lock

Description

The lock command will generate a list of +gem+ statements that will lock down the versions for the gem given in the command line. It will specify exact versions in the requirements list to ensure that the gems loaded will always be consistent. A full recursive search of all effected gems will be generated.

Example:

gemlock rails-1.0.0 > lockdown.rb

will produce in lockdown.rb:

require "rubygems"
gem 'rails', '= 1.0.0'
gem 'rake', '= 0.7.0.1'
gem 'activesupport', '= 1.2.5'
gem 'activerecord', '= 1.13.2'
gem 'actionpack', '= 1.11.2'
gem 'actionmailer', '= 1.1.5'
gem 'actionwebservice', '= 1.0.0'

Just load lockdown.rb from your application to ensure that the current versions are loaded. Make sure that lockdown.rb is loaded before any other require statements.

Notice that rails 1.0.0 only requires that rake 0.6.2 or better be used. Rake-0.7.0.1 is the most recent version installed that satisfies that, so we lock it down to the exact version.

gem outdated

Display all gems that need updates

Usage

gem outdated [options]

Options:

  • -​-platform PLATFORM - Specify the platform of gem to outdated

Deprecated Options:

  • -u, -​-[no-]update-sources - Update local source cache

Local/Remote Options:

  • -l, -​-local - Restrict operations to the LOCAL domain
  • -r, -​-remote - Restrict operations to the REMOTE domain
  • -b, -​-both - Allow LOCAL and REMOTE operations
  • -B, -​-bulk-threshold COUNT - Threshold for switching to bulk synchronization (default 1000)
  • -​-clear-sources - Clear the gem sources
  • -​-source URL - Add URL as a remote source for gems
  • -p, -​-[no-]http-proxy [URL] - Use HTTP proxy for remote operations

Common Options:

  • -h, -​-help - Get help on this command
  • -V, -​-[no-]verbose - Set the verbose level of output
  • -q, -​-quiet - Silence commands
  • -​-config-file FILE - Use this config file instead of default
  • -​-backtrace - Show stack backtrace on errors
  • -​-debug - Turn on Ruby debugging

gem owner

Manage gem owners on RubyGems.org.

Usage

gem owner [options]

Options:

  • -k, -​-key KEYNAME - Use the given API key from ~/.gem/credentials
  • -a, -​-add EMAIL - Add an owner
  • -r, -​-remove EMAIL - Remove an owner

Local/Remote Options:

  • -p, -​-[no-]http-proxy [URL] - Use HTTP proxy for remote operations

Common Options:

  • -h, -​-help - Get help on this command
  • -V, -​-[no-]verbose - Set the verbose level of output
  • -q, -​-quiet - Silence commands
  • -​-config-file FILE - Use this config file instead of default
  • -​-backtrace - Show stack backtrace on errors
  • -​-debug - Turn on Ruby debugging

Arguments

  • GEM - gem to manage owners for

Description

Manage gem owners on RubyGems.org.

gem pristine

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

Usage

gem pristine [args] [options]

Options:

  • -​-all - Restore all installed gems to pristine condition
  • -​-[no-]extensions - Restore gems with extensions
  • -v, -​-version VERSION - Specify version of gem to restore to pristine condition

Common Options:

  • -h, -​-help - Get help on this command
  • -V, -​-[no-]verbose - Set the verbose level of output
  • -q, -​-quiet - Silence commands
  • -​-config-file FILE - Use this config file instead of default
  • -​-backtrace - Show stack backtrace on errors
  • -​-debug - Turn on Ruby debugging

Arguments

  • GEMNAME - gem to restore to pristine condition (unless --all)

Description

The pristine command compares the installed gems with the contents of the cached gem and restores any files that don't match the cached gem's copy.

If you have made modifications to your installed gems, the pristine command will revert them. After all the gem's files have been checked all bin stubs for the gem are regenerated.

If the cached gem cannot be found, you will need to use gem install to revert the gem.

If --no-extensions is provided pristine will not attempt to restore gems with extensions.

gem push

Push a gem up to RubyGems.org

Usage

gem push GEM [options]

Options:

  • -k, -​-key KEYNAME - Use the given API key from ~/.gem/credentials
  • -​-host HOST - Push to another gemcutter-compatible host

Local/Remote Options:

  • -p, -​-[no-]http-proxy [URL] - Use HTTP proxy for remote operations

Common Options:

  • -h, -​-help - Get help on this command
  • -V, -​-[no-]verbose - Set the verbose level of output
  • -q, -​-quiet - Silence commands
  • -​-config-file FILE - Use this config file instead of default
  • -​-backtrace - Show stack backtrace on errors
  • -​-debug - Turn on Ruby debugging

Arguments

  • GEM - built gem to push up

Description

Push a gem up to RubyGems.org

gem query

Query gem information in local or remote repositories

Usage

gem query [options]

Options:

  • -i, -​-[no-]installed - Check for installed gem
  • -v, -​-version VERSION - Specify version of gem to query for use with -​-installed
  • -n, -​-name-matches REGEXP - Name of gem(s) to query on matches the provided REGEXP
  • -d, -​-[no-]details - Display detailed information of gem(s)
  • -​-[no-]versions - Display only gem names
  • -a, -​-all - Display all gem versions
  • -​-[no-]prerelease - Display prerelease versions

Deprecated Options:

  • -u, -​-[no-]update-sources - Update local source cache

Local/Remote Options:

  • -l, -​-local - Restrict operations to the LOCAL domain
  • -r, -​-remote - Restrict operations to the REMOTE domain
  • -b, -​-both - Allow LOCAL and REMOTE operations
  • -B, -​-bulk-threshold COUNT - Threshold for switching to bulk synchronization (default 1000)
  • -​-clear-sources - Clear the gem sources
  • -​-source URL - Add URL as a remote source for gems
  • -p, -​-[no-]http-proxy [URL] - Use HTTP proxy for remote operations

Common Options:

  • -h, -​-help - Get help on this command
  • -V, -​-[no-]verbose - Set the verbose level of output
  • -q, -​-quiet - Silence commands
  • -​-config-file FILE - Use this config file instead of default
  • -​-backtrace - Show stack backtrace on errors
  • -​-debug - Turn on Ruby debugging

gem rdoc

Generates RDoc for pre-installed gems

Usage

gem rdoc [args] [options]

Options:

  • -​-all - Generate RDoc/RI documentation for all installed gems
  • -​-[no-]rdoc - Generate RDoc HTML
  • -​-[no-]ri - Generate RI data
  • -​-[no-]overwrite - Overwrite installed documents
  • -v, -​-version VERSION - Specify version of gem to rdoc

Common Options:

  • -h, -​-help - Get help on this command
  • -V, -​-[no-]verbose - Set the verbose level of output
  • -q, -​-quiet - Silence commands
  • -​-config-file FILE - Use this config file instead of default
  • -​-backtrace - Show stack backtrace on errors
  • -​-debug - Turn on Ruby debugging

Arguments

  • GEMNAME - gem to generate documentation for (unless --all)

Description

The rdoc command builds RDoc and RI documentation for installed gems. Use --overwrite to force rebuilding of documentation.

gem search

Display all gems whose name contains STRING

Usage

gem search [STRING] [options]

Options:

  • -i, -​-[no-]installed - Check for installed gem
  • -v, -​-version VERSION - Specify version of gem to search for use with -​-installed
  • -d, -​-[no-]details - Display detailed information of gem(s)
  • -​-[no-]versions - Display only gem names
  • -a, -​-all - Display all gem versions
  • -​-[no-]prerelease - Display prerelease versions

Deprecated Options:

  • -u, -​-[no-]update-sources - Update local source cache

Local/Remote Options:

  • -l, -​-local - Restrict operations to the LOCAL domain
  • -r, -​-remote - Restrict operations to the REMOTE domain
  • -b, -​-both - Allow LOCAL and REMOTE operations
  • -B, -​-bulk-threshold COUNT - Threshold for switching to bulk synchronization (default 1000)
  • -​-clear-sources - Clear the gem sources
  • -​-source URL - Add URL as a remote source for gems
  • -p, -​-[no-]http-proxy [URL] - Use HTTP proxy for remote operations

Common Options:

  • -h, -​-help - Get help on this command
  • -V, -​-[no-]verbose - Set the verbose level of output
  • -q, -​-quiet - Silence commands
  • -​-config-file FILE - Use this config file instead of default
  • -​-backtrace - Show stack backtrace on errors
  • -​-debug - Turn on Ruby debugging

Arguments

  • STRING - fragment of gem name to search for

gem server

Documentation and gem repository HTTP server

Usage

gem server [options]

Options:

  • -p, -​-port=PORT - port to listen on
  • -d, -​-dir=GEMDIR - directories from which to serve gems multiple directories may be provided
  • -​-[no-]daemon - run as a daemon
  • -b, -​-bind=HOST,HOST - addresses to bind
  • -l, -​-launch[=COMMAND] - launches a browser window COMMAND defaults to 'start' on Windows and 'open' on all other platforms

Common Options:

  • -h, -​-help - Get help on this command
  • -V, -​-[no-]verbose - Set the verbose level of output
  • -q, -​-quiet - Silence commands
  • -​-config-file FILE - Use this config file instead of default
  • -​-backtrace - Show stack backtrace on errors
  • -​-debug - Turn on Ruby debugging

Description

The server command starts up a web server that hosts the RDoc for your installed gems and can operate as a server for installation of gems on other machines.

The cache files for installed gems must exist to use the server as a source for gem installation.

To install gems from a running server, use gem install GEMNAME --source http://gem_server_host:8808

You can set up a shortcut to gem server documentation using the URL:

http://localhost:8808/rdoc?q=%s - Firefox
http://localhost:8808/rdoc?q=* - LaunchBar

gem sources

Manage the sources and cache file RubyGems uses to search for gems

Usage

gem sources [options]

Options:

  • -a, -​-add SOURCE_URI - Add source
  • -l, -​-list - List sources
  • -r, -​-remove SOURCE_URI - Remove source
  • -c, -​-clear-all - Remove all sources (clear the cache)
  • -u, -​-update - Update source cache

Local/Remote Options:

  • -p, -​-[no-]http-proxy [URL] - Use HTTP proxy for remote operations

Common Options:

  • -h, -​-help - Get help on this command
  • -V, -​-[no-]verbose - Set the verbose level of output
  • -q, -​-quiet - Silence commands
  • -​-config-file FILE - Use this config file instead of default
  • -​-backtrace - Show stack backtrace on errors
  • -​-debug - Turn on Ruby debugging

gem specification

Display gem specification (in yaml)

Usage

gem specification [GEMFILE] [FIELD] [options]

Options:

  • -v, -​-version VERSION - Specify version of gem to examine
  • -​-platform PLATFORM - Specify the platform of gem to specification
  • -​-all - Output specifications for all versions of the gem
  • -​-ruby - Output ruby format
  • -​-yaml - Output RUBY format
  • -​-marshal - Output Marshal format

Deprecated Options:

  • -u, -​-[no-]update-sources - Update local source cache

Local/Remote Options:

  • -l, -​-local - Restrict operations to the LOCAL domain
  • -r, -​-remote - Restrict operations to the REMOTE domain
  • -b, -​-both - Allow LOCAL and REMOTE operations
  • -B, -​-bulk-threshold COUNT - Threshold for switching to bulk synchronization (default 1000)
  • -​-clear-sources - Clear the gem sources
  • -​-source URL - Add URL as a remote source for gems
  • -p, -​-[no-]http-proxy [URL] - Use HTTP proxy for remote operations

Common Options:

  • -h, -​-help - Get help on this command
  • -V, -​-[no-]verbose - Set the verbose level of output
  • -q, -​-quiet - Silence commands
  • -​-config-file FILE - Use this config file instead of default
  • -​-backtrace - Show stack backtrace on errors
  • -​-debug - Turn on Ruby debugging

Arguments

  • GEMFILE - name of gem to show the gemspec for
  • FIELD - name of gemspec field to show

gem stale

List gems along with access times

Usage

gem stale [options]

Common Options:

  • -h, -​-help - Get help on this command
  • -V, -​-[no-]verbose - Set the verbose level of output
  • -q, -​-quiet - Silence commands
  • -​-config-file FILE - Use this config file instead of default
  • -​-backtrace - Show stack backtrace on errors
  • -​-debug - Turn on Ruby debugging

gem uninstall

Uninstall gems from the local repository

Usage

gem uninstall GEMNAME [GEMNAME ...] [options]

Options:

  • -a, -​-[no-]all - Uninstall all matching versions
  • -I, -​-[no-]ignore-dependencies - Ignore dependency requirements while uninstalling
  • -x, -​-[no-]executables - Uninstall applicable executables without confirmation
  • -i, -​-install-dir DIR - Directory to uninstall gem from
  • -n, -​-bindir DIR - Directory to remove binaries from
  • -​-[no-]user-install - Uninstall from user's home directory in addition to GEM_HOME.
  • -​-[no-]format-executable - Assume executable names match Ruby's prefix and suffix.
  • -v, -​-version VERSION - Specify version of gem to uninstall
  • -​-platform PLATFORM - Specify the platform of gem to uninstall

Common Options:

  • -h, -​-help - Get help on this command
  • -V, -​-[no-]verbose - Set the verbose level of output
  • -q, -​-quiet - Silence commands
  • -​-config-file FILE - Use this config file instead of default
  • -​-backtrace - Show stack backtrace on errors
  • -​-debug - Turn on Ruby debugging

Arguments

  • GEMNAME - name of gem to uninstall

gem unpack

Unpack an installed gem to the current directory

Usage

gem unpack GEMNAME [options]

Options:

  • -​-target=DIR - target directory for unpacking
  • -​-spec - unpack the gem specification
  • -v, -​-version VERSION - Specify version of gem to unpack

Common Options:

  • -h, -​-help - Get help on this command
  • -V, -​-[no-]verbose - Set the verbose level of output
  • -q, -​-quiet - Silence commands
  • -​-config-file FILE - Use this config file instead of default
  • -​-backtrace - Show stack backtrace on errors
  • -​-debug - Turn on Ruby debugging

Arguments

  • GEMNAME - name of gem to unpack

gem update

Update the named gems (or all installed gems) in the local repository

Usage

gem update GEMNAME [GEMNAME ...] [options]

Options:

  • -​-system [VERSION] - Update the RubyGems system software
  • -​-platform PLATFORM - Specify the platform of gem to update
  • -​-[no-]prerelease - Allow prerelease versions of a gem as update targets

Deprecated Options:

  • -u, -​-[no-]update-sources - Update local source cache

Install/Update Options:

  • -i, -​-install-dir DIR - Gem repository directory to get installed gems
  • -n, -​-bindir DIR - Directory where binary files are located
  • -d, -​-[no-]rdoc - Generate RDoc documentation for the gem on install
  • -​-[no-]ri - Generate RI documentation for the gem on install
  • -E, -​-[no-]env-shebang - Rewrite the shebang line on installed scripts to use /usr/bin/env
  • -f, -​-[no-]force - Force gem to install, bypassing dependency checks
  • -w, -​-[no-]wrappers - Use bin wrappers for executables Not available on dosish platforms
  • -P, -​-trust-policy POLICY - Specify gem trust policy
  • -​-ignore-dependencies - Do not install any required dependent gems
  • -y, -​-include-dependencies - Unconditionally install the required dependent gems
  • -​-[no-]format-executable - Make installed executable names match ruby. If ruby is ruby18, foo_exec will be foo_exec18
  • -​-[no-]user-install - Install in user's home directory instead of GEM_HOME.
  • -​-development - Install any additional development dependencies
  • -​-conservative - Don't attempt to upgrade gems already meeting version requirement

Local/Remote Options:

  • -l, -​-local - Restrict operations to the LOCAL domain
  • -r, -​-remote - Restrict operations to the REMOTE domain
  • -b, -​-both - Allow LOCAL and REMOTE operations
  • -B, -​-bulk-threshold COUNT - Threshold for switching to bulk synchronization (default 1000)
  • -​-clear-sources - Clear the gem sources
  • -​-source URL - Add URL as a remote source for gems
  • -p, -​-[no-]http-proxy [URL] - Use HTTP proxy for remote operations

Common Options:

  • -h, -​-help - Get help on this command
  • -V, -​-[no-]verbose - Set the verbose level of output
  • -q, -​-quiet - Silence commands
  • -​-config-file FILE - Use this config file instead of default
  • -​-backtrace - Show stack backtrace on errors
  • -​-debug - Turn on Ruby debugging

Arguments

  • GEMNAME - name of gem to update

gem which

Find the location of a library file you can require

Usage

gem which FILE [FILE ...] [options]

Options:

  • -a, -​-[no-]all - show all matching files
  • -g, -​-[no-]gems-first - search gems before non-gems

Common Options:

  • -h, -​-help - Get help on this command
  • -V, -​-[no-]verbose - Set the verbose level of output
  • -q, -​-quiet - Silence commands
  • -​-config-file FILE - Use this config file instead of default
  • -​-backtrace - Show stack backtrace on errors
  • -​-debug - Turn on Ruby debugging

Arguments

  • FILE - name of file to find
Something went wrong with that request. Please try again.