permission denied on Gemfile.lock

12,781

Solution 1

Try deleting the Gemfile.lock and running bundle install on your server.

Solution 2

It's worth checking the owner of the lock file. Ran into this when I'd been running 'sudo bundle install' because I'd been installing the gemfiles for all users on the box. A quick 'chown' later, and everything was sorted.

Share:
12,781
Edward Ford
Author by

Edward Ford

Updated on June 04, 2022

Comments

  • Edward Ford
    Edward Ford almost 2 years

    I have got a problem deploying my app on Passenger through Capistrano.

    I can't seem to shake off a Permission denied - /path/to/app/Gemfile.lock from bundler/definition.rb. Has anyone had this before?

    I have tried chmoding and chowning the file but that hasn't helped.

    Has anybody else had the problem?

    Back trace is

    /usr/local/rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.0/lib/bundler/definition.rb 184 in `initialize'
    /usr/local/rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.0/lib/bundler/definition.rb 184 in `open'
    /usr/local/rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.0/lib/bundler/definition.rb 184 in `lock'
    /usr/local/rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.0/lib/bundler/environment.rb 39 in `lock'
    /usr/local/rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.0/lib/bundler/runtime.rb 35 in `setup'
    /usr/local/rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.0/lib/bundler.rb 100 in `setup'
    

    UPDATE: After viewing the following link - here, I managed to fix the issue by bundling on dev and then recommiting the Gemfile.lock.