Gemfile
and Gemfile.lock
to source control, but ignore the
.bundle
folder, which is specific to each machine.
$ echo ".bundle" >> .gitignore $ git add Gemfile Gemfile.lock .gitignore $ git commit -m "Add Bundler support"
vendor/bundle
directory, ensuring all your dependencies are met.
$ bundle install --deployment
Start your application servers as usual, and your application will use your bundled environment with the exact same gems you use in development.
If you have run bundle package
, the cached
gems will be used automatically.
deploy.rb
file:
require 'bundler/capistrano'
cap deploy
will now automatically run
bundle install
on the remote server with deployment-friendly
options. A list of options that can be changed is available in the help
for the cap task. To see it, run cap -e bundle:install
.
deploy.rb
.
require 'bundler/vlad'
vlad:bundle:install
task will be
available for use. Make sure it is run as part of your deploy. For example:
task "vlad:deploy" => %w[ vlad:update vlad:bundle:install vlad:start_app vlad:cleanup ]
bundle exec
to run any executables
from gems in the bundle
$ bundle exec rake db:setup
--binstubs
option on the
install command to generate executable binaries that can be used instead of
bundle exec
.
`bundle install --deployment`
. If you want to exclude certain groups using the --without
option, you need to use `heroku config`
.
$ heroku config:add BUNDLE_WITHOUT="test development" --app app_nameHeroku Bundler Documentation