LoginSignup
10
10

More than 5 years have passed since last update.

Githubで二段階認証をしているユーザーがプライベートリポジトリのgemを取得する方法

Last updated at Posted at 2016-04-21

概要

Githubのプライベートリポジトリにあるgemをbundlerで取得するときに、二段階認証をしているアカウントだとaccess tokenを使って取得する必要がある。

Gemfileのサンプル
gem 'gem_test', git: 'https://github.com/TeamName/gem_test.git'

access tokenの作成

1.GithubのSettingsからPersonal access tokensを選択して、Generate new tokenをクリックする。

2.Token descriptionに適当な名前を入れて、repoにチェックを入れてから、Generate tokenをクリックする

スクリーンショット 2016-04-21 14.51.33.png

3.作成されたaccess tokenをbundle installするときのPasswordに入れる。

スクリーンショット 2016-04-21 14.52.32.png

$ bundle install
Fetching https://github.com/TeamName/gem_test.git
Username for 'https://github.com': novless # アカウント名を入力する
Password for 'https://novless@github.com' # 作成したaccess tokenを入れる

以上

参考URL

10
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
10