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


gem 명령어 내용 정리.


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

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

    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
                                 with info about installed gems
  Further information:


지정한 gem package 를 설치한다.

Usage: 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)

  Deprecated Options:
    -u, --[no-]update-sources        Update local source cache

  Install/Update Options:
    -i, --install-dir DIR            Gem repository directory to get installed
    -n, --bindir DIR                 Directory where binary files are
    -d, --[no-]rdoc                  Generate RDoc documentation for the gem on
        --[no-]ri                    Generate RI documentation for the gem on
    -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
    -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
        --[no-]user-install          Install in user's home directory instead
                                     of GEM_HOME.
        --development                Install any additional development
        --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

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


$ 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