When working on a Ruby project, I always put the files in vendor/bundle/
. This has the benefit of having a greppable index of all the gems of your project, while keeping your global gemset tidy.
You only need to do this once in your project. The --path
setting will be persisted in your project's Bundler configuration (.bundle/config
).
Next: Why would we want to do this?
Doing this will make inspecting your gem code easier. This can be conveniently done with something like ack or the silver searcher:
Next: How do we ignore this from all repos?
I recommend placing vendor/bundle/
on a global gitignore. If you haven't set up a global gitignore list yet, it's pretty easy.
This removes the need for managing gemsets via rvm. In fact, if your project always uses the latest Ruby (which you also should, in my opinion!), you won't even need rvm at all.
Even if you don't use this tip, you actually don't need rvm gemsets at all. Bundler solves the same problem.
Next: Bonus: let's speed up our installations!
Bonus: the -j3
flag makes your installations faster by allowing 3 installs in parallel.