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.
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.
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.
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.
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.
Try deleting the Gemfile.lock and running bundle install
on your server.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With