First, make sure you have command line tools installed:
xcode-select --install
Then open Terminal.app and type:
curl https://gist.githubusercontent.com/stvnrynlds/ce4999d3175bf41ff083d5e4665ab382/raw/085b17e1fb8bc00bbc408a4ccb2b808a5e3b0f15/setup-rbenv.sh | bash