Last active
January 4, 2023 18:11
-
-
Save crazyoptimist/269bab101648d3a087780b65268abd79 to your computer and use it in GitHub Desktop.
Install rbenv on Ubuntu/Debian
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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