简体   繁体   中英

bundle install fail “..does not appear to be a git repository fatal: Could not read from remote repository.”

I have a gem file in which i am trying to get "gem 'twitter-bootstrap-rails', git: ' https://github.com/seyhunak/twitter-bootstrap-rails.git '"

Using bundle install command and it gives the below error:

C:\Sooraj\Playdrone\playdrone-master>bundle install

Fetching https://github.com/seyhunak/twitter-bootstrap-rails.git
fatal: '/cygdrive/c/Sooraj/Playdrone/playdrone-master/C:/Ruby22/lib/ruby/gems/2.
2.0/cache/bundler/git/twitter-bootstrap-rails-eff46a5fc3c9c652c290119047c5ec9247068903' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Retrying git clone --no-checkout --quiet "C:/Ruby22/lib/ruby/gems/2.2.0/cache/bundler/git/twitter-bootstrap-rails-eff46a5fc3c9c652c290119047c5ec9247068903" "C:/
Ruby22/lib/ruby/gems/2.2.0/bundler/gems/twitter-bootstrap-rails-38476dbd7f9a" 
due to error (2/4): 
Bundler::Source::Git::GitCommandError Git error: 
command `git clone --no-checkout --quiet "C:/Ruby22/lib/ruby/gems/2.2.0/cache/bundler/git/twitter-bootstrap-rails-eff46a5fc3c9c652c290119047c5ec9247068903" "C:/Ruby22/lib/ruby/gems/2.2.0/bundler/gems/twitter-bootstrap-rails-38476dbd7f9a"` 
in directory C:/Sooraj/Playdrone/playdrone-master has failed.
If this error persists you could try removing the cache directory 
'C:/Ruby22/lib/ruby/gems/2.2.0/cache/bundler/git/twitter-bootstrap-rails-eff46a5fc3c9c652c290119047c5ec9247068903'
fatal: '/cygdrive/c/Sooraj/Playdrone/playdrone-master/C:/Ruby22/lib/ruby/gems/2.2.0/cache/bundler/git/twitter-bootstrap-rails-eff46a5fc3c9c652c290119047c5ec9247068903' 
does not appear to be a git repository
fatal: Could not read from remote repository.

But the git url is correct.
Its asking me to delete the cache folder and I delete it and run the command and I get the same error.

Can anyone please help what this error is and how I can rectify?

This is similar to bundler/issues/2571 , where Cygwin was installed first (before running bundle install from a CMD.exe session, outside Cygwin)

Figured it out.
The bundler installation that came with RailsInstaller has its own git installation, but when I was calling it from cygwin it was using cygwin's git and didn't know how to handle windows-style path names.
When I tested it under CMD , I had run it from cygwin so that PATH was set wrong. I renamed cygwin's git to " git_old ".

According to the documentation , it should be:

gem 'twitter-bootstrap-rails', :git => 'git://github.com/seyhunak/twitter-bootstrap-rails.git'

You should replace 'https' with 'git'.

Why are you pulling the latest build? This is generally not a good idea unless you have a reason to do so as it is not likely to be as stable as a release. Generally, you will want the latest stable release.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM