Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

permission denied on Gemfile.lock

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.

like image 993
Edward Ford Avatar asked Feb 27 '11 19:02

Edward Ford


People also ask

What is Gemfile and Gemfile lock?

The Gemfile is where you specify which gems you want to use, and lets you specify which versions. The Gemfile. lock file is where Bundler records the exact versions that were installed. This way, when the same library/project is loaded on another machine, running bundle install will look at the Gemfile.

Should you check in Gemfile lock?

Pretty much everyone agrees you should check that into git. Including your Gemfile. lock in version control is standard practice if you are writing an application.

How do I update my Gemfile lock?

To automatically update the Gemfile. lock with your current version of Bundler, run bundle update --bundler . In general, it's a good idea to use the latest version of Bundler. That's why my Ruby on Mac script is meant to be run often to keep your system up to date with the latest versions of Bundler and Rubygems.

How do I remove gem from Gemfile lock?

You can run just bundle or bundle install to install gems based on your Gemfile. That will remove the instance of mygem from your Gemfile. lock file.


2 Answers

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

like image 67
Kevin Sylvestre Avatar answered Sep 20 '22 05:09

Kevin Sylvestre


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.

like image 34
Clive Evans Avatar answered Sep 17 '22 05:09

Clive Evans