Bundler
There is no need to do anything to make bundler work with RVM, but there is one thing about bundler that makes it harder to use. By default, bundler does not generate wrappers for gem binaries. To make use of the proper version of a gem binary, users are forced to prefix every command with `bundle exec`. This makes working in the console rather painful. Fortunately, there are solutions that allow us to just write binary names; the binary from 'gem' specified in the Gemfile will be used.
RVM hook
Thanks to Rick DeNatale, we now have a hook that automatically will append BUNDLE_BIN path to the PATH when changing directories.
Enabling hook
rvm get head && rvm reload chmod +x $rvm_path/hooks/after_cd_bundler
Generating bundler stubs (binaries wrappers)
cd /path/to/project bundle install --binstubs=./bundler_stubs
From now on, any project which was generated this way will automatically add ./bundler_stubs to the PATH.
rubygems-bundler gem
Another solution for this problem is a gem which makes bundler and rubygems generate binary wrappers that are aware of bundler. It was discussed with the rubygems and bundler teams, however,they did not really like the solution. Be forewarned, they will most likely not support it.
Installation:
gem install rubygems-bundler
And follow onscreen instructions, for more information visit rubygems-bundler @ github
To make it fully working, bundler 1.1 is required (which is not yet released). Fortunately, the rubygems plugins enabled bundler is also available for installation:
gem install mpapis-bundler
As `mpapis-bundler` already depends on `rubygems-bundler` you could skip the previous step. `mpapis-bundler` uses only code that is already in the commit tree of bundler, so you do not have to worry about compatibility.
Community Resources
- You can read bundler's README at GitHub