"Bundle install" error: cannot open .git / FETCH_HEAD: permission denied
I recently changed my ubuntu to Linux mint so I need to reinstall my gems but it gives me this error ....
The steps I took
- Generated pub / private keys and added to github.
- re run command "bundle install" but doesn't work.
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'
source to share
In my case, I am using rbenv
and have faced the same problem so far bundle install
.
Cause
when cloning rbenv
from my repo, I was unclearly using sudo
like
sudo git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
This means that the sudo
owner of the directory and other users do not have permission to access the repo.
Decision
I don't know if this is the best way to solve this problem; excuse me
I changed directory permission ~/.rbenv
sudo chmod 777 ~/.rbenv/**
source to share