Read more

Capistrano: exclude custom bundle groups for production deploy

Daniel Straßner
September 12, 2016Software engineer at makandra GmbH

Capistrano is by default configured to exclude the gems of the groups development and test when deploying to the stages production and staging. Whenever you create custom groups in your Gemfile, make sure to exclude these, if they should not be deployed to the servers. The gems of these groups might not be loaded by rails, however, the deployment process will take longer as the gems will be downloaded and installed to the server.

Illustration UI/UX Design

UI/UX Design by makandra brand

We make sure that your target audience has the best possible experience with your digital product. You get:

  • Design tailored to your audience
  • Proven processes customized to your needs
  • An expert team of experienced designers
Read more Show archive.org snapshot

e.g. to exclude the groups cucumber and deploy, add the following to config/deploy/production.rb and config/deploy/staging.rb respectively:

set :bundle_without, %w{development test cucumber deploy}.join(' ')

Be aware, that gems that belong to two groups, are only excluded, when both of the groups are excluded, e.g. to exclude rspec in the following example, you will have to bundle without test and cucumber:

group :test, :cucumber do
  gem 'rspec'
end
Posted by Daniel Straßner to makandra dev (2016-09-12 09:58)