RVM - Install bundler after any use command
12 Dec 2015If you use RVM, it’s possible that you noticed that RVM no longer ships with bundler. It’s quite boring to repeatedly type gem install bundler
every time that you installed a new Ruby or created a gemset (even if you just install bundler
in a @global
gemset).
I was a bit tired on running this every time I installed a new ruby or created a new gemset, and decided to write a RVM hook that reminds be that I don’t have bundler installed, and will do this for me automatically :)
Here’s the bash script:
Just pick this script and save on the ~/.rvm/hooks
folder with the after_use_[any name you like]
pattern, and make it executable.
Example:
After this, every time RVM execute a “use” command (cd to a project folder with .ruby-version
/.ruby-gemset
files or explicitly running rvm use
), it’ll install bundler if that’s not detected.