【问题标题】:bundle install fail "..does not appear to be a git repository fatal: Could not read from remote repository."捆绑安装失败“.. 似乎不是 git 存储库致命:无法从远程存储库读取。”
【发布时间】:2015-09-22 08:28:20
【问题描述】:

我有一个我想要获取的 gem 文件 "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 是正确的。
它要求我删除缓存文件夹,我删除它并运行命令,我得到同样的错误。

谁能帮忙看看这个错误是什么以及如何纠正?

【问题讨论】:

    标签: ruby-on-rails ruby git ruby-on-rails-3 twitter-bootstrap


    【解决方案1】:

    根据documentation,应该是:

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

    您应该将“https”替换为“git”。

    为什么要拉最新版本?除非您有理由这样做,否则这通常不是一个好主意,因为它不太可能像发行版那样稳定。通常,您需要最新的稳定版本。

    【讨论】:

    • 是的先生,我也试过了,它说同样的错误......而且我从 git hub 下载了一个项目......他们有这个 gemfile 和 gemfile.lock 所以应该我删除了他们的 gemfile.lock 然后运行 ​​bundle install ??因为那个锁文件是他们的..
    • 是的,你绝对应该自己运行 bundle install 。 Gemfile.lock 特定于您的项目(您的宝石/版本组合)。我想我的回答一定有问题,因此无法解释,但我仍然强烈建议您尽可能使用最新版本的 gem,方法是将 gem twitter-bootstrap-rails 放入您的 gemfile 并运行 bundle install。
    • 是的,先生,这已得到纠正,我被以下问题困扰了 4 小时stackoverflow.com/questions/31236420/… 安装了 cmake,现在卡在“正在检查 cmake...是检查 gmake...不检查 make。 .. 是检查 pkg-config... 没有错误:构建 Rugged 需要 pkg-config。*** extconf.rb 失败 ***"
    • 我可以在 Windows 中轻松安装坚固的 gem 吗?我似乎有很多固有的依赖关系
    • 对不起@Srini 我对 Windows 环境中的开发不太熟悉。您是否尝试仅安装最新版本的 gem?如果是这样,也许用您当前的 gem 文件和您看到的错误更新您的 OP。
    【解决方案2】:

    这类似于 bundler/issues/2571,其中首先安装了 Cygwin(在从 CMD.exe 会话运行 bundle install 之前,在 Cygwin 之外)

    想通了。
    RailsInstaller 附带的 bundler 安装有自己的 git 安装,但是当我从 cygwin 调用它时,它使用的是 cygwin 的 git,并且不知道如何处理 windows 样式的路径名。
    当我在CMD 下测试它时,我是从 cygwin 运行它,所以 PATH 设置错误。 我将 cygwin 的 git 重命名为“git_old”。

    【讨论】:

      猜你喜欢
      • 2015-11-21
      • 2020-01-20
      • 2012-11-10
      • 2011-11-11
      • 2015-01-19
      • 1970-01-01
      • 2019-10-24
      • 2015-07-01
      • 2013-04-13
      相关资源
      最近更新 更多