Gem

From 탱이의 잡동사니
Jump to: navigation, search

Overview

gem 명령어 내용 정리.

help

$ gem help
RubyGems is a sophisticated package manager for Ruby.  This is a
basic help message containing pointers to more information.

  Usage:
    gem -h/--help
    gem -v/--version
    gem command [arguments...] [options...]

  Examples:
    gem install rake
    gem list --local
    gem build package.gemspec
    gem help install

  Further help:
    gem help commands            list all 'gem' commands
    gem help examples            show some examples of usage
    gem help platforms           show information about platforms
    gem help <COMMAND>           show help on COMMAND
                                   (e.g. 'gem help install')
    gem server                   present a web page at
                                 http://localhost:8808/
                                 with info about installed gems
  Further information:
    http://rubygems.rubyforge.org

install

지정한 gem package 를 설치한다.

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

-v, --version

지정한 버전의 패키지를 설치한다.

Example

$ sudo gem install redis -v 3.3.3
Fetching: redis-3.3.3.gem (100%)
Successfully installed redis-3.3.3
Parsing documentation for redis-3.3.3
Installing ri documentation for redis-3.3.3
Done installing documentation for redis after 1 seconds
1 gem installed