LoginSignup
3
4

More than 5 years have passed since last update.

privateなGithubレポジトリをbundle installする

Posted at

結論

personal access tokenで作ってbundler configに加えます。

やりかた

Gemfileには形式はgitでプロトコルはhttpsを指定します。
(github形式だとgitプロトコルになってしまったので、その対応です)

Gemfile

gem 'private', git: 'https://github.com/myoan/private.git'

Githubでpersonal access tokenを作ります。
(tokenをどこかにメモしてください。)

スクリーンショット 2017-01-10 17.50.30.png

bundle configでbundlerに設定を加えます。

-> % bundle config https://github.com/myoan/private.git myoan:<PERSONAL_ACCESS_TOKEN>
-> % cat ~/.bundle/config
---
BUNDLE_BUILD__NOKOGIRI: "--use-system-libraries"
BUNDLE_BUILD__MYSQL2: "--local --with-opt-lib=/usr/local/opt/openssl/lib --with-opt-include=-I/usr/local/opt/openssl/include"
BUNDLE_HTTPS://GITHUB__COM/MYOAN/PRIVATES__GIT/: "myoan:<PERSONAL_ACCESS_TOKEN>"

この状態でbundle installを実行。
うまくいったら成功です!

参照

3
4
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
3
4