Gemfile.lockto source control, but ignore the
.bundlefolder, which is specific to each machine.
$ echo ".bundle\n" >> .gitignore $ git add Gemfile Gemfile.lock .gitignore $ git commit -m "Add Bundler support"
vendor/bundledirectory, 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.
cap deploywill now automatically run
bundle installon 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.
vlad:bundle:installtask 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 execto run any executables from gems in the bundle
$ bundle exec rake db:setup
--binstubsoption on the install command to generate executable binaries that can be used instead of
`bundle install --deployment`. If you want to exclude certain groups using the
--withoutoption, you need to use
$ heroku config:add BUNDLE_WITHOUT="test development" --app app_nameHeroku Bundler Documentation