https://github.com/capistrano/bundler
Bundler support for Capistrano 3.x
https://github.com/capistrano/bundler
Keywords
bundler capistrano
Keywords from Contributors
ssh deployment activerecord mvc activejob rubygems rubocop rack rspec static-code-analysis
Last synced: about 19 hours ago
JSON representation
Repository metadata
Bundler support for Capistrano 3.x
- Host: GitHub
- URL: https://github.com/capistrano/bundler
- Owner: capistrano
- License: mit
- Created: 2013-08-09T15:01:44.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2025-11-25T06:38:18.000Z (3 months ago)
- Last Synced: 2026-02-14T01:29:54.890Z (17 days ago)
- Topics: bundler, capistrano
- Language: Ruby
- Homepage:
- Size: 97.7 KB
- Stars: 221
- Watchers: 11
- Forks: 78
- Open Issues: 9
- Releases: 10
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
README.md
Capistrano::Bundler
Bundler specific tasks for Capistrano v3:
$ cap production bundler:install
It also prefixes certain binaries to use bundle exec.
Installation
Add these lines to your application's Gemfile [Recommended]:
gem 'capistrano', '~> 3.6'
gem 'capistrano-bundler', '~> 2.0'
And then execute:
$ bundle
Or install it yourself as:
$ gem install capistrano-bundler
Usage
Require in Capfile to use the default task:
require 'capistrano/bundler'
The task will run before deploy:updated as part of Capistrano's default deploy, or can be run in isolation with cap production bundler:install.
In order for Bundler to work efficiently on the server, its project configuration directory (<release_path>/.bundle/) should be persistent across releases.
You need to add it to the linked_dirs Capistrano variable:
Capistrano 3.5+:
# config/deploy.rb
append :linked_dirs, '.bundle'
Capistrano < 3.5:
# config/deploy.rb
set :linked_dirs, fetch(:linked_dirs, []) << '.bundle'
It will still work fine with non-persistent configuration directory, but then it will have to re-resolve all gems on each deploy.
By default, the plugin adds bundle exec prefix to common executables listed in bundle_bins option. This currently applies for gem, rake and rails.
You can add any custom executable to this list:
set :bundle_bins, fetch(:bundle_bins, []).push('my_new_binary')
Configurable options:
set :bundle_roles, :all # this is default
set :bundle_config, { deployment: true } # this is default
set :bundle_servers, -> { release_roles(fetch(:bundle_roles)) } # this is default
set :bundle_binstubs, -> { shared_path.join('bin') } # default: nil
set :bundle_binstubs_command, :install # this is default
set :bundle_gemfile, -> { release_path.join('MyGemfile') } # default: nil
set :bundle_path, -> { shared_path.join('bundle') } # this is default. set it to nil to use bundler's default path
set :bundle_without, %w{development test}.join(':') # this is default
set :bundle_flags, '--quiet' # this is default
set :bundle_env_variables, {} # this is default
set :bundle_clean_options, "" # this is default. Use "--dry-run" if you just want to know what gems would be deleted, without actually deleting them
set :bundle_check_before_install, true # default: true. Set this to false to bypass running `bundle check` before executing `bundle install`
set :bundle_version, 2 # default: 2. Set to 4 for Bundler 4 compatibility
If you are using Bundler 4 (which is the default in Ruby 4),
make sure to set :bundle_version to avoid deprecation warnings:
set :bundle_version, 4
You can parallelize the installation of gems with bundler's jobs feature.
Choose a number less or equal than the number of cores your server.
set :bundle_jobs, 8 # default: 4, only available for Bundler >= 1.4
To generate binstubs on each deploy, set :bundle_binstubs path:
set :bundle_binstubs, -> { shared_path.join('bin') }
In the result this would execute the following bundle commands on all servers
(actual paths depend on the real deploy directory):
$ bundle config --local deployment true
$ bundle config --local gemfile /my_app/releases/20130623094732/MyGemfile
$ bundle config --local path /my_app/shared/bundle
$ bundle config --local without "development test"
$ bundle install --quiet --binstubs /my_app/shared/bin
If any option is set to nil it will be excluded from the final bundle commands.
If you want to clean up gems after a successful deploy, add after 'deploy:published', 'bundler:clean' to config/deploy.rb.
Downsides to cleaning:
- If a rollback requires rebuilding a Gem with a large compiled binary component, such as Nokogiri, the rollback will take a while.
- In rare cases, if a gem that was used in the previously deployed version was yanked, rollback would entirely fail.
If you're using Bundler >= 2.1 and you are generating binstubs, you can configure capistrano-bundler to use the newer
bundle binstubs command. This will avoid the deprecation warning that you'd otherwise get when using bundle install
to generate binstubs:
set :bundle_binstubs_command, :binstubs
Environment Variables
The bundle_env_variables option can be used to specify any environment variables you want present when running the bundle command:
# This translates to NOKOGIRI_USE_SYSTEM_LIBRARIES=1 when executed
set :bundle_env_variables, { nokogiri_use_system_libraries: 1 }
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request
Owner metadata
- Name: Capistrano
- Login: capistrano
- Email:
- Kind: organization
- Description:
- Website: http://www.capistranorb.com/
- Location:
- Twitter:
- Company:
- Icon url: https://avatars.githubusercontent.com/u/58257?v=4
- Repositories: 26
- Last ynced at: 2024-03-25T19:42:03.135Z
- Profile URL: https://github.com/capistrano
GitHub Events
Total
- Release event: 1
- Delete event: 1
- Issues event: 1
- Watch event: 2
- Issue comment event: 2
- Create event: 1
Last Year
- Release event: 1
- Delete event: 1
- Issue comment event: 1
- Create event: 1
Committers metadata
Last synced: 1 day ago
Total Commits: 94
Total Committers: 32
Avg Commits per committer: 2.938
Development Distribution Score (DDS): 0.702
Commits in past year: 2
Committers in past year: 1
Avg Commits per committer in past year: 2.0
Development Distribution Score (DDS) in past year: 0.0
| Name | Commits | |
|---|---|---|
| Matt Brictson | m****t@m****m | 28 |
| Kir Shatrov | s****v@m****m | 17 |
| Tom Clements | s****e@g****m | 6 |
| Thomas Kriechbaumer | k****r@g****m | 5 |
| Chad Wilken | c****n@g****m | 4 |
| Tobias Bühlmann | t****n@t****m | 3 |
| Andrew Babichev | a****v@g****m | 2 |
| Dave Kroondyk | d****o@g****m | 2 |
| Isaac Betesh | i****h@g****m | 2 |
| Lee Hambley | l****y@g****m | 2 |
| abdelkader boudih | t****e@g****m | 2 |
| William Johnston | w****n@m****g | 1 |
| Dave Slutzkin | d****n@f****m | 1 |
| Gonzalo Robaina | g****o@r****e | 1 |
| Ilya Vassilevsky | v****y@g****m | 1 |
| Jared Beck | j****d@j****m | 1 |
| Jean Boussier | j****r@g****m | 1 |
| Juan Ibiapina | j****a@g****m | 1 |
| Martin Madsen | m****n@g****m | 1 |
| Michael MacDonald | m****l@s****u | 1 |
| Nick Hammond | n****k@n****m | 1 |
| Nikolay Rys | n****y@r****e | 1 |
| PJ Kelly | pj@c****m | 1 |
| Tomas Varaneckas | t****s@g****m | 1 |
| Víctor M. Valenzuela | v****v@v****t | 1 |
| William Johnston | w****n@d****m | 1 |
| William Johnston | w****m@j****s | 1 |
| Yuichiro Suzuki | u****u@g****m | 1 |
| bob1983 | b****g@g****m | 1 |
| danarnold | d****8@g****m | 1 |
| and 2 more... | ||
Committer domains:
- johnstonhaus.us: 1
- drip.com: 1
- vemv.net: 1
- crushlovely.com: 1
- rys.me: 1
- nickhammond.com: 1
- starclass.com.au: 1
- jaredbeck.com: 1
- robaina.me: 1
- fastmail.fm: 1
- mpr.org: 1
- thisisdmg.com: 1
- me.com: 1
- mattbrictson.com: 1
Issue and Pull Request metadata
Last synced: 3 days ago
Total issues: 45
Total pull requests: 63
Average time to close issues: 9 months
Average time to close pull requests: 5 months
Total issue authors: 42
Total pull request authors: 42
Average comments per issue: 4.89
Average comments per pull request: 3.89
Merged pull request: 41
Bot issues: 0
Bot pull requests: 0
Past year issues: 2
Past year pull requests: 1
Past year average time to close issues: 2 months
Past year average time to close pull requests: about 14 hours
Past year issue authors: 2
Past year pull request authors: 1
Past year average comments per issue: 1.0
Past year average comments per pull request: 2.0
Past year merged pull request: 1
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
- mattbrictson (4)
- Altonymous (1)
- ayoubkhobalatte (1)
- ant0nm (1)
- vzamanillo (1)
- gamafranco (1)
- vcavallo (1)
- craibuc (1)
- ryanbooker (1)
- northbear (1)
- wcc526 (1)
- climatebrad (1)
- Fjan (1)
- gajendrajena (1)
- amw (1)
Top Pull Request Authors
- mattbrictson (12)
- Kriechi (3)
- betesh (3)
- vassilevsky (3)
- will-in-wi (2)
- spajic (2)
- kirs (2)
- pjkelly (2)
- yock (1)
- daveslutzkin (1)
- jdxcode (1)
- mgrachev (1)
- SeanSith (1)
- danarnold (1)
- Hirurg103 (1)
Top Issue Labels
- bug? (1)
- discuss! (1)
- documentation (1)
- you can help! (1)
- new feature (1)
Top Pull Request Labels
- 📚 Docs (3)
- 🏠 Housekeeping (3)
- ✨ Feature (2)
- ⚠️ Breaking (1)
- 🐛 Bug Fix (1)
Package metadata
- Total packages: 2
-
Total downloads:
- rubygems: 101,021,244 total
- Total docker downloads: 35,394,110
- Total dependent packages: 51 (may contain duplicates)
- Total dependent repositories: 23,179 (may contain duplicates)
- Total versions: 32
- Total maintainers: 4
gem.coop: capistrano-bundler
Bundler support for Capistrano 3.x
- Homepage: https://github.com/capistrano/bundler
- Documentation: http://www.rubydoc.info/gems/capistrano-bundler/
- Licenses: MIT
- Latest release: 2.2.0 (published 3 months ago)
- Last Synced: 2026-03-01T10:03:55.740Z (2 days ago)
- Versions: 16
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 50,509,652 Total
- Docker Downloads: 17,697,055
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 0.38%
- Downloads: 0.503%
- Docker downloads count: 1.015%
- Maintainers (4)
rubygems.org: capistrano-bundler
Bundler support for Capistrano 3.x
- Homepage: https://github.com/capistrano/bundler
- Documentation: http://www.rubydoc.info/gems/capistrano-bundler/
- Licenses: MIT
- Latest release: 2.2.0 (published 3 months ago)
- Last Synced: 2026-03-01T17:02:53.531Z (1 day ago)
- Versions: 16
- Dependent Packages: 51
- Dependent Repositories: 23,179
- Downloads: 50,511,592 Total
- Docker Downloads: 17,697,055
-
Rankings:
- Dependent repos count: 0.234%
- Downloads: 0.466%
- Dependent packages count: 0.521%
- Docker downloads count: 1.114%
- Average: 1.512%
- Forks count: 2.902%
- Stargazers count: 3.837%
- Maintainers (4)
Dependencies
- bundler ~> 2.1 development
- danger >= 0 development
- rake >= 0 development
- capistrano ~> 3.1
- release-drafter/release-drafter v5 composite
Score: 27.635201756221146