从git源协议切换到加密的https

时间:2016-12-27 08:34:40

标签: git macos rubygems bundler

根据此github issue conversation和此answer to a relevant SO question我执行了以下两个命令:

$isolated

但是当我使用$ bundle config --global github.https true $ git config --global url."https://github.com".insteadOf git://github.com 时,我仍然收到以下警告信息:gits未加密的协议:

bundle install

两者:
The git source uses the `git` protocol, which transmits data without encryption. Disable this warning with `bundle config git.allow_insecure true`, or switch to the `https` protocol to keep your data secure.
git://github.com/jnicklas/capybara.git

值得的:
Bundler版本1.13.6
git版本2.10.1(Apple Git-78)
(注意:git是通过Xcode with developers tools)安装的 此外,在我输入这些命令之前,我收到了与其他宝石相关的四个警告。输入命令后,我仍然会对这两个进行警告。我查看了“capybara”和“shoulda-matchers”的README.md文件,但没有找到任何表明此问题的解决方案或原因。 最后,git://github.com/thoughtbot/shoulda-matchers.git报告:

bundle install

1 个答案:

答案 0 :(得分:2)

原来是〜/ project / Gemfile指定了github源:

group :test do
  gem 'shoulda-matchers', :git => 'git://github.com/thoughtbot/shoulda-matchers.git'
  gem 'capybara', :git => 'git://github.com/jnicklas/capybara.git'
end

删除, :git => 'PATH'让我获得最新宝石的安全https协议安装。额外的奖励:当我gem list时,宝石现在也出现了...... FWIW:这不是我从头开始编写的项目,我只是帮助他们的人,但现在我知道了!