LoginSignup
2
2

More than 5 years have passed since last update.

bundler が git プロトコルではなく、https プロトコルを使うように設定する

Posted at

はじめに

bundler '1.14.6' を使いはじめ、
git://github.com/hogehoge のような git プロトコルを使うと https プロトコルに変えろと warning が出るようになったのと、
チームで開発していて自分は git プロトコル、他の誰かは https プロトコルの場合、
bundle install すると他の人の Gemfile.lock では https プロトコルで書かれていた部分が
再び git プロトコルで書き直されるのがウザかったので、https プロトコルに合わせるように bundle を設定します。

設定

まずは bundle の設定の確認。
bundle config と叩くと現在の bundle の設定が表示されます。

その中に

github.https
Set for the current user (/Users/username/.bundle/config): "true"

のような記述がなければ、https に設定されていません。

ちなみに私の場合は /Users/username/.bundle/config のパスに設定がありましたが、人によっては app 配下にあったり、環境変数にあるかもしれないので私と同じパスになかったら確認してみてください。(詳しくは こちらのページ に載っています。)

先程のコマンドを叩いて https プロトコルを使う設定がない場合は、

bundle config  github.https true

と叩くと https プロトコルに設定されます。
(上記コマンドは bundle config <設定> <値>)

まとめ

上記コマンドを叩き、再び bundle config を叩くと github.https が true に設定されるはず。

参考

http://ruby.studio-kingdom.com/bundler/bundle_config/
http://y-yagi.tumblr.com/post/150244664010/bundler-1130%E3%81%A7gemfile%E3%81%AB-github

2
2
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
2
2