Clone the repo into a hidden home directory
git clone git://github.com/sstephenson/rbenv.git ~/.rbenv
Add ~/.rbenv/bin to your $PATH for access to the rbenv command-line utility
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.profile
Add rbenv init to your shell to enable shims and autocompletion.
echo 'eval "$(rbenv init -)"' >> ~/.profile
Restart your shell as a login shell so the path changes take effect. You can now begin using rbenv.
exec $SHELL -l
Install ruby-build, which provides an
rbenv install command that simplifies the process of installing new Ruby versions.
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
This will install the latest development version of ruby-build into the
~/.rbenv/plugins/ruby-build directory. From that directory, you can check out a specific release tag. To update ruby-build, run
git pull to download the latest changes.
rbenv install 1.9.3-p327
As an alternative, you can download and compile Ruby yourself into ~/.rbenv/versions/.
Rebuild the shim executables. You should do this any time you install a new Ruby executable (for example, when installing a new Ruby version, or when installing a gem that provides a command).