Skip to content

Instantly share code, notes, and snippets.

@guiocavalcanti
Created April 3, 2014 14:23
Show Gist options
  • Save guiocavalcanti/9955285 to your computer and use it in GitHub Desktop.
Save guiocavalcanti/9955285 to your computer and use it in GitHub Desktop.

Often we need to use a gem from local file system while developing it. Bundle provides local gem overrides targeting this.

Assume my Gemfile is something like:

# Gemfile
gem 'fuelzee', git: 'git@github.com:Fuelzee/fuelzee-ruby.git'
  branch: 'master'

If I want to use a local gem:

$ bundle config local.fuelzee ~/workspace/work/fuelzee/fuelzee-ruby/
$ bundle
Fetching gem metadata from https://rubygems.org/........
Using fuelzee (0.0.1) from https://github.com/Fuelzee/fuelzee-ruby.git (at /Users/guiocavalcanti/workspace/work/fuelzee/fuelzee-ruby)

If I want to switch back:

$ bundle config --delete local.fuelzee
$ bundle
Fetching git@github.com:Fuelzee/fuelzee-ruby.git
Cloning into bare repository '/Users/guiocavalcanti/.rvm/gems/ruby-2.0.0-p353/cache/bundler/git/fuelzee-ruby-050d51c08e595629d27c034c46aa6ce53ba12a7b'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment