Skip to content

Instantly share code, notes, and snippets.

@berga
Forked from jnx/rbenv-install-system-wide.sh
Last active April 24, 2019 01:42
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save berga/913c4156064dfdd22d913304bc854033 to your computer and use it in GitHub Desktop.
Save berga/913c4156064dfdd22d913304bc854033 to your computer and use it in GitHub Desktop.
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