Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"bundle install" error: cannot open .git/FETCH_HEAD: Permission denied

I recently changed my ubuntu to Linux mint so i need to re-install my gems but it gives me this error....

Steps i have done

  • Generated pub/private keys and added to github.
  • re run command "bundle install" but its not working.

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'
like image 425
user3013437 Avatar asked Dec 11 '14 06:12

user3013437


2 Answers

If you are using rvm, From the command line run:

~> rvm fix-permissions

This solved that kind of error for me.

like image 198
jonnysamps Avatar answered Nov 04 '22 09:11

jonnysamps


bundle exec bundle install

worked for me. I made the mistake of installing ruby when I was logged in as root so I have to do this now until I fix the problem.

like image 35
boulder_ruby Avatar answered Nov 04 '22 08:11

boulder_ruby