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.
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