Last Updated: February 25, 2016
·
1.299K
· timmoore

Keeping Your Bundler Gems Isolated

I recently switched my laptop from rvm to rbenv.

The first time I ran bundle install in a project, it installed all of the gems into the gem directory for the Ruby version I was using with rbenv. I was hoping it would keep them isolated to the project.

Although it's not automatic, this is easy to do:
bundle config path vendor/bundle
Now bundler will install all gems into the vendor/bundle directory of each of your projects. You should probably add that directory to .gitignore.

Hat tip to http://dan.carley.co/blog/2012/02/07/rbenv-and-bundler/

1 Response
Add your response

If you want to be suuuper lazy, you can even do bundle config path ./bundle/gems, since you've probably already gitignored .bundle.

over 1 year ago ·