Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save aribeiro/48861a2c72200f8de300f35eee00e0fc to your computer and use it in GitHub Desktop.
Save aribeiro/48861a2c72200f8de300f35eee00e0fc to your computer and use it in GitHub Desktop.
Install Ruby 1.8.7 with rbenv on Ubuntu
# Install system libraries.
sudo apt-get install zlib1g-dev openssl libssl-dev libreadline-dev git-core
# Install rbenv.
git clone git://github.com/sstephenson/rbenv.git ~/.rbenv
# Setup bash.
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
exec $SHELL
# Install rbenv plugins.
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
# Install Ruby version 1.8.7.
CONFIGURE_OPTS="--with-readline-dir=/usr/include/readline --with-openssl-dir=/usr/include/openssl" rbenv install 1.8.7-p370
# Update shims.
rbenv rehash
# Set global (default) Ruby version.
rbenv global 1.8.7-p370
# Test Ruby version.
rbenv which ruby
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment