Skip to content

Instantly share code, notes, and snippets.

@pvin
Last active January 26, 2018 12:04
Show Gist options
  • Select an option

  • Save pvin/51af0fdb9a7793faf1a6e82fe1c2f457 to your computer and use it in GitHub Desktop.

Select an option

Save pvin/51af0fdb9a7793faf1a6e82fe1c2f457 to your computer and use it in GitHub Desktop.
rbenv installation
You first need to uninstall the ruby installed by Ubuntu with something like sudo apt-get remove ruby.
Then reinstall ruby using rbenv and ruby-build according to their docs:
cd $HOME
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
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
exec $SHELL
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
exec $SHELL
rbenv install 2.3.1
rbenv global 2.3.1
ruby -v
gem install bundler
rbenv rehash
rbenv global 2.4.0 && rbenv rehash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment