-
Notifications
You must be signed in to change notification settings - Fork 62
Bundler
This page highlights the features of the 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.
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
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
When including eycap
in your Gemfile
and in your :development
group, just add the :require => false
to the end of your gem statement like so:
group :development do
gem "eycap", :require => false
end
And then it won't need it as a runtime dependency for the app to run, but it will still be documented and installed when you bundle install.