First, install ruby-build and chruby:
brew install chruby ruby-build
Then install your ruby version:
ruby-build 2.1.0 ~/.rubies/ruby-2.1.0
Note that chruby
looks in ~/.rubies
for a directory matching the name it finds in your .ruby-version
file.
Once installed, add the following lines to your ~/.bashrc or ~/.zshrc file:
source /usr/local/share/chruby/chruby.sh
source /usr/local/share/chruby/auto.sh
The second line is optional but it's recommended since it will change your ruby version automatically
when you cd into a directory with a .ruby-version
file.
After that, install bundler:
gem install bundler
Finally, add the following line to your ~/.bundle/config
file:
BUNDLE_PATH: ".bundle"
If the file doesn't exist you need to create it and add three dashes in the first line, then add the directive.
That will make bundler to install the dependencies into a .bundle
directory inside your project's root folder
(instead of globally).