"捆绑安装"错误:无法打开.git / FETCH_HEAD:权限被拒绝

时间:2014-12-11 06:42:10

标签: ruby-on-rails git

我最近将我的ubuntu改为Linux薄荷,所以我需要重新安装我的宝石,但它给了我这个错误....

我已完成的步骤

  • 生成的pub / private密钥并添加到github。
  • 重新运行命令"捆绑安装"但它不起作用。

Fetching git://github.com/seuros/capistrano-puma.git
error: cannot open .git/FETCH_HEAD: Permission denied

Retrying git fetch --force --quiet --tags 


"/home/asad/.bundler/cache/git/capistrano-puma-e90ae8bdcca081264c0ff67caa1d11e89f7a01e0" due to error (2/3): Bundler::Source::Git::GitCommandError Git error: command `git fetch --force --quiet --tags "/home/asad/.bundler/cache/git/capistrano-puma-e90ae8bdcca081264c0ff67caa1d11e89f7a01e0"` in directory /usr/local/rvm/gems/ruby-2.0.0-p598/bundler/gems/capistrano-puma-7748efb9a53d has failed.
        If this error persists you could try removing the cache directory '/home/asad/.bundler/cache/git/capistrano-puma-e90ae8bdcca081264c0ff67caa1d11e89f7a01e0'
        error: cannot open .git/FETCH_HEAD: Permission denied

        Retrying git fetch --force --quiet --tags "/home/asad/.bundler/cache/git/capistrano-puma-e90ae8bdcca081264c0ff67caa1d11e89f7a01e0" due to error (3/3): Bundler::Source::Git::GitCommandError Git error: command `git fetch --force --quiet --tags "/home/asad/.bundler/cache/git/capistrano-puma-e90ae8bdcca081264c0ff67caa1d11e89f7a01e0"` in directory /usr/local/rvm/gems/ruby-2.0.0-p598/bundler/gems/capistrano-puma-7748efb9a53d has failed.
        If this error persists you could try removing the cache directory '/home/asad/.bundler/cache/git/capistrano-puma-e90ae8bdcca081264c0ff67caa1d11e89f7a01e0'
        error: cannot open .git/FETCH_HEAD: Permission denied

        Git error: command `git fetch --force --quiet --tags "/home/asad/.bundler/cache/git/capistrano-puma-e90ae8bdcca081264c0ff67caa1d11e89f7a01e0"` in directory
        /usr/local/rvm/gems/ruby-2.0.0-p598/bundler/gems/capistrano-puma-7748efb9a53d has failed.
        If this error persists you could try removing the cache directory '/home/asad/.bundler/cache/git/capistrano-puma-e90ae8bdcca081264c0ff67caa1d11e89f7a01e0'

4 个答案:

答案 0 :(得分:11)

如果您使用rvm,请从命令行运行:

~> rvm fix-permissions

这解决了我的这种错误。

答案 1 :(得分:0)

升级捆绑包时遇到了同样的问题...原来捆绑系统安装位置的缓存目录导致了问题。清除这个问题完全解决了问题 - 这是在OSX上,而不是使用RVM,但是标准OSX ruby​​ on 10.10.3

答案 2 :(得分:-2)

试试这个,它对我有用。

httpd

答案 3 :(得分:-5)

嗯..这不是最好的答案,但是:

sudo bundle install