Skip to content

Instantly share code, notes, and snippets.

@stevensona
Last active September 23, 2018 01:08
Show Gist options
  • Save stevensona/0cecbbdc8701b3aef2d38faabbdb232b to your computer and use it in GitHub Desktop.
Save stevensona/0cecbbdc8701b3aef2d38faabbdb232b to your computer and use it in GitHub Desktop.
Bash script to install Install ruby 2.3.1 on ubuntu 16
#!/bin/bash
sudo apt-get update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev
cd
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
git clone https://github.com/rbenv/rbenv-gem-rehash.git ~/.rbenv/plugins/rbenv-gem-rehash
. ~/.bashrc
rbenv install 2.3.1
rbenv global 2.3.1
ruby -v
gem install bundler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment