我已经安装了 oh-my-zshell,这些是我的插件
plugins=(git rails ruby coffee npm bundler)
我可以正常运行 npm,但是每当我在 m 项目中运行 bundle install 时都会出现此错误
etching [email protected]:company/feature.git
error: cannot open .git/FETCH_HEAD: Permission denied
Retrying git fetch --force --quiet --tags "/Users/username/.bundler/cache/git/feature-f4806bda91cc5c0ec60094eaaf874acb2cc908a0" due to error (2/3): Bundler::Source::Git::GitCommandError Git error: command `git fetch --force --quiet --tags "/Users/username/.bundler/cache/git/feature-f4806bda91cc5c0ec60094eaaf874acb2cc908a0"` in directory /Library/Ruby/Gems/2.0.0/bundler/gems/feature-c27c388ea2d0 has failed.
If this error persists you could try removing the cache directory '/Users/username/.bundler/cache/git/feature-f4806bda91cc5c0ec60094eaaf874acb2cc908a0'
error: cannot open .git/FETCH_HEAD: Permission denied
Retrying git fetch --force --quiet --tags "/Users/username/.bundler/cache/git/feature-f4806bda91cc5c0ec60094eaaf874acb2cc908a0" due to error (3/3): Bundler::Source::Git::GitCommandError Git error: command `git fetch --force --quiet --tags "/Users/username/.bundler/cache/git/feature-f4806bda91cc5c0ec60094eaaf874acb2cc908a0"` in directory /Library/Ruby/Gems/2.0.0/bundler/gems/feature-c27c388ea2d0 has failed.
If this error persists you could try removing the cache directory '/Users/username/.bundler/cache/git/feature-f4806bda91cc5c0ec60094eaaf874acb2cc908a0'
error: cannot open .git/FETCH_HEAD: Permission denied
Git error: command `git fetch --force --quiet --tags
"/Users/username/.bundler/cache/git/feature-f4806bda91cc5c0ec60094eaaf874acb2cc908a0"` in directory
/Library/Ruby/Gems/2.0.0/bundler/gems/feature-c27c388ea2d0 has failed.
If this error persists you could try removing the cache directory
'/Users/username/.bundler/cache/git/feature-f4806bda91cc5c0ec60094eaaf874acb2cc908a0'
答案1
编辑:看起来如果使用 bundler 插件您需要使用 bi 或 bundle_install 而不是 bundle install 请参阅下面的评论。
嗯,根据错误判断,我认为您没有读取或写入 git 文件夹的权限。
尝试:
# chmod -R o+rw .git
在你的项目的根源处。