DEV Community

Lam
Lam

Posted on

Bundler Cheat Sheet

Rake Gem tasks

# Rakefile
require 'bundler/gem_tasks'
Enter fullscreen mode Exit fullscreen mode

Terminal:

$ rake release
$ rake build
Enter fullscreen mode Exit fullscreen mode




Local gem development

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

Deployment

$ bundle install --without=test,development --deployment
Enter fullscreen mode Exit fullscreen mode




Grouping


group :development do
gem 'hello'
end
Enter fullscreen mode Exit fullscreen mode




Github support


gem 'hello', github: 'rstacruz/hello'
gem 'hello', github: 'rstacruz/hello', 'branch: master'
Enter fullscreen mode Exit fullscreen mode




Gems


gem 'hello'
gem 'hello', group: 'development'
Enter fullscreen mode Exit fullscreen mode




Commands


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

Enter fullscreen mode Exit fullscreen mode




Reference

Top comments (0)