error: "fatal: I don't handle protocol ``git`

2019-02-17 19:16发布

I have the following line in my GemFile :

gem 'rails', :git => 'git://github.com/rails/rails.git'

I get the following error:

Fetching git://github.com/rails/rails.git
fatal: I don't handle protocol ''git'
Git error: command `git clone 'git://github.com/rails/rails.git'...

but when I run gem install 'rails' it works fine.

basically when running the clone command, bundler adds the single quotes around the git:// address which throws the error.

I am working on windows. Any ideas why I am getting this error?

Cheers

2条回答
▲ chillily
2楼-- · 2019-02-17 20:15

Try this instead in your Gemfile:

gem 'rails', :git => "https://github.com/rails/rails.git"

git:// can sometimes be blocked by firewalls. Though in your case that's probably not the issue. Try double quotes instead.

查看更多
时光不老,我们不散
3楼-- · 2019-02-17 20:21

It's the issue with the newer version of the Bundler 1.0.14.

I needed to revert to 1.0.13 to make it work. They apparently had some issues dealing with escape characters in Windows.

See here > https://github.com/carlhuda/bundler/issues/1212

查看更多
登录 后发表回答