First prepare your Mac for Developer Mode™.
xcode-select --install
(now all sorts of stuff works)- Install homebrew
Install rbenv and use it to install a Ruby:
brew install rbenv ruby-build
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
rbenv install