Paperclip gem“不是git存储库”

时间:2014-06-14 16:56:52

标签: ruby-on-rails git github gem paperclip

我在添加

后运行bundle install
gem "paperclip", :git => "git://github.com/thoughtbot/paperclip.git"

到我的Gemfile,我收到以下错误:

  

S-406c8f0a8159:etsydemo vivian.zhang $ bundle install   正在更新git://github.com/thoughtbot/paperclip.git   致命的:不是git存储库(或任何父目录):。git   由于错误,重试git fetch --force --quiet --tags'git://github.com/thoughtbot/paperclip.git'“refs / heads / :refs / heads / ” / 3):Bundler :: Source :: Git :: GitCommandError Git错误:目录中的命令git fetch --force --quiet --tags 'git://github.com/thoughtbot/paperclip.git' "refs/heads/*:refs/heads/*" /Users/vivian.zhang/.rvm/gems/ruby-2.1.2/cache/bundler/git/paperclip -61f74de14812cabc026967a2b2c3ca8cbd2eed69失败。   如果此错误仍然存​​在,您可以尝试删除缓存目录'/Users/vivian.zhang/.rvm/gems/ruby-2.1.2/cache/bundler/git/paperclip-61f74de14812cabc026967a2b2c3ca8cbd2eed69'   致命的:不是git存储库(或任何父目录):。git   由于错误,重试git fetch --force --quiet --tags'git://github.com/thoughtbot/paperclip.git'“refs / heads / :refs / heads / ” / 3):Bundler :: Source :: Git :: GitCommandError Git错误:目录中的命令git fetch --force --quiet --tags 'git://github.com/thoughtbot/paperclip.git' "refs/heads/*:refs/heads/*" /Users/vivian.zhang/.rvm/gems/ruby-2.1.2/cache/bundler/git/paperclip -61f74de14812cabc026967a2b2c3ca8cbd2eed69失败。   如果此错误仍然存​​在,您可以尝试删除缓存目录'/Users/vivian.zhang/.rvm/gems/ruby-2.1.2/cache/bundler/git/paperclip-61f74de14812cabc026967a2b2c3ca8cbd2eed69'   致命的:不是git存储库(或任何父目录):。git   Git错误:命令git fetch --force --quiet --tags 'git://github.com/thoughtbot/paperclip.git' "refs/heads/*:refs/heads/*" in   目录   /Users/vivian.zhang/.rvm/gems/ruby-2.1.2/cache/bundler/git/paperclip-61f74de14812cabc026967a2b2c3ca8cbd2eed69   失败了。   如果此错误仍然存​​在,您可以尝试删除缓存目录   '/Users/vivian.zhang/.rvm/gems/ruby-2.1.2/cache/bundler/git/paperclip-61f74de14812cabc026967a2b2c3ca8cbd2eed69'

我一直在搜索,似乎这意味着git存储库不存在。但是,我直接从文档中复制并粘贴了,所以我不知道该怎么做。当我将它放入我的Gemfile时也会发生同样的事情:

gem 'paperclip', github: 'thoughtbot/paperclip' 

这是我的整个Gemfile:

source 'https://rubygems.org'
gem 'rails', '4.1.1'
gem 'sqlite3'
gem 'sass-rails', '~> 4.0.3'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'bootstrap-sass', '~> 3.1.1'
gem "paperclip", :git => "git://github.com/thoughtbot/paperclip.git"
gem 'sdoc', '~> 0.4.0',          group: :doc
gem 'spring',        group: :development

非常感谢任何帮助!

1 个答案:

答案 0 :(得分:0)

不是用回形针 gem,但我在使用 2020-12-30 选项和 bundler 1.17.2 的 gem 行中遇到了类似的问题。

它显示的消息与您粘贴的内容非常相似:

github:

这是我解决问题的方法:

fatal: Not a git repository (or any of the parent directories): .git 
Retrying git fetch --force --quiet --tags 
    'git://github.com/thoughtbot/paperclip.git' "refs/heads/:refs/heads/" 
    due to error (2/3): 
Bundler::Source::Git::GitCommandError Git error: 
    command git fetch --force --quiet --tags 'git://github.com/thoughtbot/paperclip.git' "refs/heads/*:refs/heads/*" 
in directory 
    /Users/vivian.zhang/.rvm/gems/ruby-2.1.2/cache/bundler/git/paperclip-61f74de14812cabc026967a2b2c3ca8cbd2eed69 
has failed. 

If this error persists you could try removing the cache directory 
'/Users/vivian.zhang/.rvm/gems/ruby-2.1.2/cache/bundler/git/paperclip-61f74de14812cabc026967a2b2c3ca8cbd2eed69'

我不知道为什么打包器会创建不包含 # Create missing `refs` directory in each bundler's git-repo cache: cd /Users/vivian.zhang/.rvm/gems/ruby-2.1.2/cache/bundler/git bash -xc 'for i in *; do mkdir -p $i/refs/{heads,tags}; done' 目录的 git-repo 缓存。无论如何,创建 refs 目录似乎是解决问题的方法。