bundle install
刚开始对我(Mac OS X Snow Leopard)失败了一个源自github存储库的gem。过去工作得很好。这是错误消息:
error: insufficient permission for adding an object to repository database ./objects
fatal: failed to write object
fatal: unpack-objects failed
An error has occurred in git when running `git fetch --force --quiet --tags "git://github.com/plataformatec/devise.git" refs/heads/*:refs/heads/*`. Cannot complete bundling.
从Gemfile中,这是gem行:
gem 'devise', :git => 'git://github.com/plataformatec/devise.git'
我尝试过“捆绑安装 - 系统”,但似乎也没有解决问题。如果我指定一个类似“bundle install --path = .bundle / gems”的路径,我可以让它工作。但是我想弄清楚的是它曾经工作的原因,但不再适用。
如果指定--system?
,bundler会在哪里尝试安装git repo gems答案 0 :(得分:1)
在应用程序的目录中尝试bundle config
。我假设您创建了一个Gemfile而没有先运行bundle init
,因此您没有.bundle/config
包含:
---
BUNDLE_DISABLE_SHARED_GEMS: "1"
答案 1 :(得分:0)
看起来我找到了自己的答案:
在Snow Leopard下,repo gems存储在:
/Library/Ruby/Gems/1.8/cache/bundler/git
事实证明,以某种方式获得了该目录中缓存的设计仓库的权限。要解决这个问题,我所要做的就是sudo删除该repo并重新运行bundle install。