Created
January 5, 2017 01:17
-
-
Save lecoueyl/0614477edb025e62df66805691ce794d to your computer and use it in GitHub Desktop.
rbenv-install-system-wide.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install rbenv | |
git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv | |
git clone https://github.com/rbenv/ruby-build.git /usr/local/rbenv/plugins/ruby-build | |
# Add rbenv to the path: | |
echo '# rbenv setup - only add RBENV PATH variables if no single user install found' > /etc/profile.d/rbenv.sh | |
echo 'if [[ ! -d "${HOME}/.rbenv" ]]; then' >> /etc/profile.d/rbenv.sh | |
echo ' export RBENV_ROOT=/usr/local/rbenv' >> /etc/profile.d/rbenv.sh | |
echo ' export PATH="$RBENV_ROOT/bin:$PATH"' >> /etc/profile.d/rbenv.sh | |
echo ' eval "$(rbenv init -)"' >> /etc/profile.d/rbenv.sh | |
echo 'fi' >> /etc/profile.d/rbenv.sh | |
chmod +x /etc/profile.d/rbenv.sh | |
source /etc/profile.d/rbenv.sh | |
# Install Ruby 2.2.5: | |
rbenv install 2.2.5 | |
rbenv global 2.2.5 | |
# Rehash: | |
rbenv rehash |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment