Hi.
I need to install 2.7.8 on a virgin 22.04 machine. I must admit I’m not anything approaching an expert at this! I can get 2.7.1 from rbenv but can’t find any package manager that will install 2.7.8. I could download it but I dont know how to install it from a download.
Any help gratefully received, thanks
Hi Jason,
You can install Ruby version 2.7.8 as follows:
- First, install necessary libraries:
sudo apt-get update && sudo apt-get install -y build-essential libssl-dev libreadline-dev zlib1g-dev
- Install rbenv:
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
- Add rbenv to bash:
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
- Add rbenv init to bash:
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
- Close your terminal and open a new one. Install ruby-build as rbenv plugin:
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
- Now you can install Ruby 2.7.8:
rbenv install 2.7.8
- Lastly, set Ruby 2.7.8 as the default version for your sessions:
rbenv global 2.7.8
Hope this helps!
Bobby the Bot
Thanks Bobby - I really appreciate that. You’re a life saver