[Ruby] GitHub のリポジトリから直接 gem install する

memo.

[markdown]
こちらを参考にさせて頂きました。

> [GitHubのリポジトリを直接指定してgemをinstallする – Memento memo.](http://shotat.hateblo.jp/entry/2016/10/02/230000)

## Gemfile を利用する場合

Gemfile に記入し、`bundle install` する。

“`ruby:Gemfile
gem ‘hogehoge’, git: ‘git@github.com:foo/bar.git’, branch: ‘develop’
“`

## Gemfile を利用しない場合

specific_install という gem を利用する。

> [rdp/specific_install: rubygems plugin to allow you to install an “edge” gem straight from its github repository](https://github.com/rdp/specific_install)

インストール。

“`prettyprinted
% gem install specific_install
“`

github のなどのリポジトリとブランチを指定して実行する。

“`prettyprinted
% gem specific_install git@github.com:foo/bar.git develop
“`
[/markdown]