Skip to content
7hunderbird edited this page Sep 7, 2012 · 9 revisions

This page highlights the features of the bundler recipe.

Enable Bundler Recipe

Currently the bundler:bundle_gems recipe runs as a after hook of the deploy:symlink_configs task. You will see in your deploy.rb file a line like:

after "deploy:update_code", "deploy:symlink_configs"

There must be a "deploy:symlink_configs" task in your deploy.rb file or else the bundler:bundle_gems task will not run.

Read the code of the recipe.

Disable Bundler By Application Server

Given that you are using a Shared File system for multiple Application servers, and you do not need to have bundler install gems more than once. You'll need to add a :no_bundle => true to your deploy.rb file and the secondary application servers.

task :production do
  role :web, "123.123.123.123:7000" 
  role :app, "123.123.123.123:7000", :unicorn => true
  role :db , "123.123.123.123:7000", :primary => true
  role :app, "123.123.123.123:7001", :unicorn => true, :no_release => true, :no_symlink => true, :no_bundle => true
  set :rails_env, "production"
  set :environment_database, defer { production_database }
  set :environment_dbhost, defer { production_dbhost }
end

Bundle Without Specified Groups

If you manage your Gemfile with specific groups and would like Bundler to skip installing those groups on deployment, please add this option to your deploy.rb file:

set :bundle_without, "test deployment ci"

This would overwrite the default which would be test deployment and then run this during the deploy:

bundle install --without test deployment ci
Clone this wiki locally