layout | title | previous | next |
---|---|---|---|
default |
Command Reference |
/patterns |
/specification-reference |
What each gem
command does, and how to use it.
- gem build
- gem cert
- gem check
- gem cleanup
- gem contents
- gem dependency
- gem environment
- gem fetch
- gem generate_index
- gem help
- gem install
- gem list
- gem lock
- gem outdated
- gem owner
- gem pristine
- gem push
- gem query
- gem rdoc
- gem search
- gem server
- gem sources
- gem specification
- gem stale
- gem uninstall
- gem unpack
- gem update
- gem which
Build a gem from a gemspec
gem build GEMSPEC_FILE [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
- GEMSPEC_FILE - gemspec file name to build a gem for
Manage RubyGems certificates and signing settings
gem cert [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.
-
-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
Check installed gems
gem check [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
-
-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
Clean up old versions of installed gems in the local repository
gem cleanup [GEMNAME ...] [options]
-
- -d, --dryrun
-
-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
- GEMNAME - name of gem to cleanup
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.
Display the contents of the installed gems
gem contents GEMNAME [GEMNAME ...] [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
-
-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
- GEMNAME - name of gem to list contents for
Show the dependencies of an installed gem
gem dependency GEMNAME [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)
-
-u, -​-\[no-\]update-sources - Update local source cache
-
-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
-
-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
- GEMNAME - name of gem to show dependencies for
Display information about the RubyGems environment
gem environment [arg] [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
- 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
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
Download a gem and place it in the current directory
gem fetch GEMNAME [GEMNAME ...] [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
-
-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
-
-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
- GEMNAME - name of gem to download
Generates the index files for a gem server directory
gem generate_index [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-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
-
-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
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.
Provide help on the 'gem' command
gem help ARGUMENT [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
- commands - List all 'gem' commands
- examples - Show examples of 'gem' usage
- <command> - Show specific help for <command>
Install a gem into the local repository
gem install GEMNAME [GEMNAME ...] [options] -- --build-flags [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)
-
-u, -​-\[no-\]update-sources - Update local source cache
-
-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
-
-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
-
-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
- GEMNAME - name of gem to install
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)
$
Display gems whose name starts with STRING
gem list [STRING] [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
-
-u, -​-\[no-\]update-sources - Update local source cache
-
-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
-
-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
- STRING - start of gem name to look for
Generate a lockdown list of gems
gem lock GEMNAME-VERSION [GEMNAME-VERSION ...] [options]
-
-s, -​-\[no-\]strict - fail if unable to satisfy a dependency
-
-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
- GEMNAME - name of gem to lock
- VERSION - version of gem to lock
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.
Display all gems that need updates
gem outdated [options]
-
-​-platform PLATFORM - Specify the platform of gem to outdated
-
-u, -​-\[no-\]update-sources - Update local source cache
-
-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
-
-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
Manage gem owners on RubyGems.org.
gem owner [options]
-
-k, -​-key KEYNAME - Use the given API key from ~/.gem/credentials
-
-a, -​-add EMAIL - Add an owner
-
-r, -​-remove EMAIL - Remove an owner
-
-p, -​-\[no-\]http-proxy \[URL\] - Use HTTP proxy for remote operations
-
-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 - gem to manage owners for
Manage gem owners on RubyGems.org.
Restores installed gems to pristine condition from files located in the gem cache
gem pristine [args] [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
-
-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
- GEMNAME - gem to restore to pristine condition (unless --all)
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.
Push a gem up to RubyGems.org
gem push GEM [options]
-
-k, -​-key KEYNAME - Use the given API key from ~/.gem/credentials
-
-​-host HOST - Push to another gemcutter-compatible host
-
-p, -​-\[no-\]http-proxy \[URL\] - Use HTTP proxy for remote operations
-
-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 - built gem to push up
Push a gem up to RubyGems.org
Query gem information in local or remote repositories
gem query [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
-
-u, -​-\[no-\]update-sources - Update local source cache
-
-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
-
-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
Generates RDoc for pre-installed gems
gem rdoc [args] [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
-
-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
- GEMNAME - gem to generate documentation for (unless --all)
The rdoc command builds RDoc and RI documentation for installed gems. Use --overwrite to force rebuilding of documentation.
Display all gems whose name contains STRING
gem search [STRING] [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
-
-u, -​-\[no-\]update-sources - Update local source cache
-
-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
-
-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
- STRING - fragment of gem name to search for
Documentation and gem repository HTTP server
gem server [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
-
-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
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:https://gem_server_host:8808
You can set up a shortcut to gem server documentation using the URL:
http:https://localhost:8808/rdoc?q=%s - Firefox
http:https://localhost:8808/rdoc?q=* - LaunchBar
Manage the sources and cache file RubyGems uses to search for gems
gem sources [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
-
-p, -​-\[no-\]http-proxy \[URL\] - Use HTTP proxy for remote operations
-
-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
Display gem specification (in yaml)
gem specification [GEMFILE] [FIELD] [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
-
-u, -​-\[no-\]update-sources - Update local source cache
-
-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
-
-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
- GEMFILE - name of gem to show the gemspec for
- FIELD - name of gemspec field to show
List gems along with access times
gem stale [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
Uninstall gems from the local repository
gem uninstall GEMNAME [GEMNAME ...] [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
-
-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
- GEMNAME - name of gem to uninstall
Unpack an installed gem to the current directory
gem unpack GEMNAME [options]
-
-​-target=DIR - target directory for unpacking
-
-​-spec - unpack the gem specification
-
-v, -​-version VERSION - Specify version of gem to unpack
-
-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
- GEMNAME - name of gem to unpack
Update the named gems (or all installed gems) in the local repository
gem update GEMNAME [GEMNAME ...] [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
-
-u, -​-\[no-\]update-sources - Update local source cache
-
-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
-
-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
-
-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
- GEMNAME - name of gem to update
Find the location of a library file you can require
gem which FILE [FILE ...] [options]
-
-a, -​-\[no-\]all - show all matching files
-
-g, -​-\[no-\]gems-first - search gems before non-gems
-
-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
- FILE - name of file to find