Bundler Cheat Sheet

From WikiOD

Here is the cheatsheat of Bundler and basic guide on how to use Bundler

Commands[edit | edit source]

bundle                  # same as bundle install
bundle install          # installs gems
bundle install -j3      # faster (3 jobs)
bundle update           # update all gems
bundle update --source gemname  # update specified gem

bundle outdated         # show outdated gems
cd `bundle show rails`  # inspect a gem's dir

bundle gem              # new gem skeleton

Gems[edit | edit source]

gem 'hello'
gem 'hello', group: 'development'

Github support[edit | edit source]

gem 'hello', github: 'rstacruz/hello'
gem 'hello', github: 'rstacruz/hello', 'branch: master'

Grouping[edit | edit source]

group :development do
  gem 'hello'
end

Deployment[edit | edit source]

$ bundle install --without=test,development --deployment

Local gem development[edit | edit source]

In your Gemfile, define a Git source and a branch:

gem 'hello', github: 'rstacruz/hello', branch: 'master'

And then:

$ bundle config --global local.xxx ~/projects/xxx

Rake Gem tasks[edit | edit source]

# Rakefile
require 'bundler/gem_tasks'

Terminal:

$ rake release
$ rake build

Credit:rstacruz