Techioz Blog

gem の依存関係を表示するコマンド?

概要

gem が依存する他の gem を知らせるコマンドはありますか?

また、Gem の依存関係を自動インストールする方法はありますか?

解決策

次の情報は、以下にリンクされている Rubygems コマンド リファレンスから取得したものです。

http://guides.rubygems.org/command-reference/#gem-dependency

あなたが求めている最初のコマンドは「gem dependency」です。以下にコマンドの説明を記載します。

gem dependency GEMNAME [options]

Options:
-v, --version VERSION            Specify version of gem to dependency
-r, --[no-]reverse-dependencies  Include reverse dependencies in the output
-p, --pipe                       Pipe Format (name --version ver)

Common Options:
    --source URL                 Use URL as the remote source for gems
-h, --help                       Get help on this command
    --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 gems to show

Summary:
Show the dependencies of an installed gem

Defaults:
--version '> 0' --no-reverse

2 番目に必要なコマンドは「gem install」です。依存関係は自動的にインストールされます。詳細については、コマンド リファレンスからの以下の引用文をお読みください。