Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
rbenv install and system wide install on Ubuntu 16.04 LTS.
# Update, upgrade and install development tools:
apt update
apt -y upgrade
apt -y install build-essential git-core
# Install rbenv
git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv
# Add rbenv to the path:
echo '# rbenv setup' > /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
chmod +x /etc/profile.d/rbenv.sh
source /etc/profile.d/rbenv.sh
# Install ruby-build:
git clone git://github.com/sstephenson/ruby-build.git /usr/local/rbenv/plugins/ruby-build
git clone https://github.com/rbenv/rbenv-default-gems.git /usr/local/rbenv/plugins/rbenv-default-gems
echo bundler >> /usr/local/rbenv/default-gems
# Install Ruby:
rbenv install 2.4.2
rbenv global 2.4.2
# Rehash:
rbenv rehash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.