Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to specify path to Gemfile.lock during bundle install with capistrano

My directory structure is as follows:

application/
  tmp/
  rails_code/Capfile
  rails_code/config/deploy.rb
  rails_code/Gemfile
  rails_code/Gemfile.lock
  non_rails_code/

I am using capistrano to deploy the application code, but when i run cap deploy, then it fails to install gems using bundler, because it expects the Gemfile.lock to be in the application directory, whereas it is actually in the application/rails_code directory.

How can i specify the correct location of the Gemfile?

like image 233
umar Avatar asked Nov 22 '11 16:11

umar


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.

Is Gemfile lock automatically generated?

Gemfile. lock is automatically generated when you run bundle install or bundle update . It should never be edited manually.


1 Answers

This is configurable, do:

set :bundle_gemfile,  "rails_code/Gemfile"
like image 148
umar Avatar answered Nov 01 '22 13:11

umar