我有一个我试图获得的宝石文件 “gem'twitter-bootstrap-rails',git:'https://github.com/seyhunak/twitter-bootstrap-rails.git'”
使用bundle install
命令,它会出现以下错误:
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.
但是git url是正确的。
它要求我删除缓存文件夹,然后删除它并运行命令,我得到同样的错误。
任何人都可以帮助解决这个错误以及如何纠正错误吗?
答案 0 :(得分:2)
这类似于bundler/issues/2571,其中首先安装了Cygwin(在Cygwin之外的bundle install
会话中运行CMD.exe
之前)
想出来。
bundler
附带的RailsInstaller
安装有自己的git安装,但是当我从cygwin调用它时,它使用的是cygwin的git,并且不知道如何处理windows风格的路径名。 /> 当我在CMD
下测试它时,我从cygwin运行它以便PATH设置错误。 我将cygwin的git重命名为“git_old
”。
答案 1 :(得分:0)
根据documentation,它应该是:
gem 'twitter-bootstrap-rails', :git => 'git://github.com/seyhunak/twitter-bootstrap-rails.git'
您应该更换' https'与' git'。
为什么要拉最新版本?这通常不是一个好主意,除非你有理由这样做,因为它不太可能像发布一样稳定。通常,您需要最新的稳定版本。