`bundle install`失败(因为git协议) [英] `bundle install` fails (because of git protocol)
问题描述
使用这个简单的Gemfile,
With this simple Gemfile,
source 'https://rubygems.org'
gem 'activerecord', "~> 2.2.3"
gem 'activerecord-sqlserver-adapter', github: 'arthrex/activerecord-sqlserver-adapter', :branch => '2-3-stable'
捆绑安装
与
bundle install
fails with
Fetching git://github.com/arthrex/activerecord-sqlserver-adapter.git
fatal: unable to connect to github.com:
github.com[0: 192.30.252.131]: errno=No error
Git error: command `git clone
"git://github.com/arthrex/activerecord-sqlserver-adapter.git"
"c:/Languages/Ruby/1.9.3/lib/ruby/gems/1.9.1/cache/bundler/git/activerecord-sqlserver-adapter-8019982c6a12a1297e8a135275
d94bdee6cd893b"
--bare --no-hardlinks` in directory c:/Users/BZISAD0/Code/CSV has failed.
起初我以为我的代理配置被搞砸了,但我可以毫不费力的执行这个命令:
At first I thought my proxy configurations were screwed up but I can execute this command with no problem:
$ git clone http://github.com/arthrex/activerecord-sqlserver-adapter.git
然而,使用git协议会失败:
With the git protocol, however, it fails:
$ git clone git://github.com/arthrex/activerecord-sqlserver-adapter.git
Cloning into 'activerecord-sqlserver-adapter'...
fatal: unable to connect to github.com:
github.com[0: 192.30.252.130]: errno=No error
所以我推断代理与git协议并不合适。无论如何,无论出于何种原因,http运行良好,但git协议不是。
so I'm inferring that the proxy is not playing nice with the git protocol. At any rate, for whatever reason, http is working fine but the git protocol is not.
有没有办法解决这个问题?例如。在我的〜/中配置使用
? http://
而不是 git://
.gitconfig
Is there a way to work around this? E.g. configuring the use of http://
rather than git://
in my ~/.gitconfig
?
推荐答案
不要使用 github:
您的Gemfile中的简写形式,只需使用常规 git:
语法
Don't use the github:
short form in your Gemfile, just use the regular git:
syntax
gem 'activerecord-sqlserver-adapter', git: 'http://github.com/arthrex/activerecord-sqlserver-adapter.git'
这篇关于`bundle install`失败(因为git协议)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!