As @AWippler stated in his comment, install rbenv in a location other than the user's home directory. Install in the /var/opt/rbenv directory.
sudo git clone https://github.com/sstephenson/rbenv.git /var/opt/rbenv
It is important to all adjust user permissions. There are a variety of ways to accomplish this. I add the users to a group called devops.
sudo groupadd devops
sudo usermod -a -G devops username
sudo chgrp -R devops /var/opt/rbenv/
sudo chmod 0775 /var/opt/rbenv
sudo chmod g+s -R /var/opt/rbenv/
Next the $RBENV_PATH needs to be shared as well. Create a rbenv.sh script inside /etc/profile.d.
echo 'export RBENV_ROOT=/var/opt/rbenv' | sudo tee -a '/etc/profile.d/rbenv.sh'
echo 'export PATH=$RBENV_ROOT/bin:$PATH' | sudo tee -a '/etc/profile.d/rbenv.sh'
echo 'eval "$(rbenv init -)"' | sudo tee -a '/etc/profile.d/rbenv.sh'
sudo chgrp devops /etc/profile.d/rbenv.sh
sudo chmod 0660 /etc/profile.d/rbenv.sh
source /etc/profile.d/rbenv.sh
Finally, install rbenv and the version that you prefer.
cd /tmp
sudo git clone https://github.com/sstephenson/ruby-build.git
sudo ./ruby-build/install.sh
rbenv install ruby-version
rbenv shell ruby-version
rbenv global ruby-version
rbenv rehash
Note: When installing gems via bundler, be sure to use bundle install --system
to share with all users.