Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marshallmick007/5422389659dba9310e5c0ab8b97895d0 to your computer and use it in GitHub Desktop.
Save marshallmick007/5422389659dba9310e5c0ab8b97895d0 to your computer and use it in GitHub Desktop.
rbenv install and system wide install on Ubuntu 10.04 LTS.
#!/bin/bash
# Update, upgrade and install development tools:
# apt-get update
# apt-get -y upgrade
# apt-get -y install build-essential
# apt-get -y install 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
# ... and for zsh too
echo '# rbenv setup' >> /etc/zsh/zprofile
echo 'export RBENV_ROOT=/usr/local/rbenv' >> /etc/zsh/zprofile
echo 'export PATH="$RBENV_ROOT/bin:$PATH"' >> /etc/zsh/zprofile
echo 'eval "$(rbenv init -)"' >> /etc/zsh/zprofile
chmod +x /etc/profile.d/rbenv.sh
source /etc/profile.d/rbenv.sh
# Install ruby-build:
git clone https://github.com/rbenv/ruby-build.git /usr/local/rbenv/plugins/ruby-build
# Install Ruby 2.4.1:
rbenv install 2.4.1
rbenv global 2.4.1
# Rehash:
rbenv rehash
gem install bundler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment