Install
$ anyenv install rbenv
$ rbenv install X.X.X
(snip)
$ rbenv global X.X.X
$ rbenv rehash
$ rbenv exec gem install bundler
ローカルの Gemfile を利用する
$ vi Gemfile
$ bundle install --path vendor/bundle
$ bundle exec ruby example.rb
rbenv で gem を使った時に自動的に rbenv rehash
zshrcfunction gem(){
$RBENV_ROOT/shims/gem $*
if [ "$1" = "install" ] || [ "$1" = "i" ] || [ "$1" = "uninstall" ] || [ "$1" = "uni" ]
then
rbenv rehash
rehash
fi
}
Reference
rbenv で gem を使った時に rbenv rehash しなくて良くする - sorry, uninuplemented:http://rhysd.hatenablog.com/entry/20120226/1330265121