Skip to content

Instantly share code, notes, and snippets.

@lsaffie
Last active December 21, 2015 05:39
Show Gist options
  • Save lsaffie/6258406 to your computer and use it in GitHub Desktop.
Save lsaffie/6258406 to your computer and use it in GitHub Desktop.
#!/bin/bash
# One stop-shop to install rbenv, friends and ruby 1.9.3
# Author: Luis Saffie <luis@saffie.ca>
# USAGE: curl https://gist.github.com/lsaffie/6258406/raw/rbenv-ubuntu-install |bash
echo "========================="
echo "remove rvm"
echo "========================="
sudo rvm implode |echo "yes"
sudo rm -fr /etc/rvmrc
sudo rm -fr /etc/rvm
echo "========================="
echo "install git-core and curl"
echo "========================="
sudo apt-get -y install curl
echo "========================="
echo "installing rbenv"
echo "========================="
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
echo "========================="
echo "including rbenv in path"
echo "========================="
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.profile
echo "========================="
echo "Shims and automcompletion"
echo "========================="
echo 'eval "$(rbenv init -)"' >> ~/.profile
echo "========================="
echo "reload bash profile"
echo "========================="
source ~/.profile
echo "========================="
echo "ruby build"
echo "========================="
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
echo "========================="
echo "Here's ruby 1.9.3-p448"
echo "========================="
rbenv install 1.9.3-p448
rbenv global 1.9.3-p448
rbenv rehash
echo "========================="
echo "updating rbenv and plugins"
echo "========================="
rbenv update
echo "========================="
echo "restart shell"
echo "========================="
source ~/.profile
echo "========================="
echo "install bundler"
echo "========================="
echo "gem: --no-rdoc --no-ri" >> ~/.gemrc
gem install bundler
rbenv rehash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment