How To Install Ruby 3 With rbenv?
Naive as I am, I fired up my terminal and gave it a spontaneous shot:
You will most probably encounter this issue when you have rbenv
lying around for quite a while already. So the investigation continued:
Where's Ruby 3 in rbenv? 🤔 🔎
rbenv install Ruby 3 on Ubuntu
The sad truth is that my brain was not able to parse the whole terminal output which already poses the solution:
With the missing information bit, we are now just 2 terminal commands away from victory.
1. Upgrade the rbenv build
~ git -C ~/.rbenv/plugins/ruby-build pull
remote: Enumerating objects: 254, done.
remote: Counting objects: 100% (254/254), done.
remote: Compressing objects: 100% (22/22), done.
... more output ...
2. Install version 3
~ rbenv install 3.0.0
Downloading ruby-3.0.0.tar.gz...
-> https://cache.ruby-lang.org/pub/ruby/3.0/ruby-3.0.0.tar.gz
Installing ruby-3.0.0...
... ⏲⏲⏲ ...
... ⏲⏲⏲ ...
... ⏲⏲⏲ ...
Installed ruby-3.0.0 to ~/.rbenv/versions/3.0.0
3. (bonus) Check it's installed
~ rbenv versions
2.6.6
* 2.7.1 (set by ~/.rbenv/version)
3.0.0 🎊🎊🎊
And for the sake of completeness and inclusiveness, let's see how it's done on the other operating that exists in this world:
rbenv install Ruby 3 on MacOS
If you installed rbenv
via homebrew
you'll need to do brew upgrade
which will also update your rbenv
so that latest stable versions of Ruby should appear in your rbenv.
If you are not using homebrew
I don't know what you are doing, and most probably you know what you are doing (but then, why are you here?).
Comments or questions? Just tweet it out to me!
Tweet to @RichStoneIO