Skip to content

Instantly share code, notes, and snippets.

@crazyoptimist
Last active January 4, 2023 18:11
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 crazyoptimist/269bab101648d3a087780b65268abd79 to your computer and use it in GitHub Desktop.
Save crazyoptimist/269bab101648d3a087780b65268abd79 to your computer and use it in GitHub Desktop.
Install rbenv on Ubuntu/Debian
# Install build dependencies for ruby(https://github.com/rbenv/ruby-build/wiki#suggested-build-environment)
sudo apt-get install -y autoconf bison patch build-essential rustc libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libgmp-dev libncurses5-dev libffi-dev libgdbm6 libgdbm-dev libdb-dev uuid-dev
# Install rbenv using git
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'eval "$(~/.rbenv/bin/rbenv init - bash)"' >> ~/.bashrc
source ~/.bashrc
# Install ruby-build plugin for rbenv
git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build
# List available ruby versions
rbenv install --list
# Install a ruby version you need
rbenv install 3.1.3
rbenv versions
# Set the global ruby version on the machine
rbenv global 3.1.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment