2013-12-19 201 views
3

有了這個簡單的Gemfile,`束install`失敗

source 'https://rubygems.org' 
gem 'activerecord', "~> 2.2.3" 
gem 'activerecord-sqlserver-adapter', github: 'arthrex/activerecord-sqlserver-adapter', :branch => '2-3-stable' 

bundle install失敗

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. 

起初我還以爲我的代理服務器配置都搞砸了,但我可以執行(因爲Git協議的)這個命令沒有問題:

$ git clone http://github.com/arthrex/activerecord-sqlserver-adapter.git 

但是,使用git協議失敗:

$ 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協議不是。

有沒有辦法解決這個問題?例如。在我的~/.gitconfig中配置使用http://而不是git://

回答

12

不要使用github:縮寫形式在Gemfile中,只需使用常規git:語法

gem 'activerecord-sqlserver-adapter', git: 'http://github.com/arthrex/activerecord-sqlserver-adapter.git'