10

rbenv install --list-all shows me, among many other things of course,

3.0.0-dev
3.0.0-preview1
3.0.0-preview2

But where is 3.0.0 itself, the actual final release? I'd like to try it out. Not all announced features made it into the previews so I need the real thing.

matt
  • 515,959
  • 87
  • 875
  • 1,141

3 Answers3

12

rbenv install passes thru ruby-build. You need to update (brew upgrade if installed via Homebrew) your ruby-build in order to see the latest versions.

matt
  • 515,959
  • 87
  • 875
  • 1,141
8

Ubuntu

(I prefer cloning the repo to get the latest version of rbenv). If you are ok with outdated verions, then use a package manager: sudo apt install rbenv

Install using git:

  1. git clone https://github.com/rbenv/rbenv.git ~/.rbenv ** (pulls latest ruby versions)
  2. rbenv install 3.0.0 (or for later versions: 3.x.x)
  3. echo "3.0.0" > .ruby-version OR rbenv local 3.0.0 to ensure ruby 3.0.0 is used. Of course, choose your ruby version: 3.x.x.

Mac

brew upgrade

Obsolete instructions:

** Older versions had the following: git -C ~/.rbenv/plugins/ruby-build pull

BenKoshy
  • 33,477
  • 14
  • 111
  • 80
  • 1
    (i improved the formatting) - but substantive credit to @RichSteinmetz – BenKoshy Mar 19 '21 at 04:02
  • And to me. All in all seems rather otiose to me, just repeating both existing answers. – matt Mar 19 '21 at 05:09
  • @matt yes absolutely agreed --> the only difference is in formatting. but my theory is that formatting does makes a big difference. this will be an interesting academic experiment nonetheless. – BenKoshy Mar 19 '21 at 06:19
  • 1
    thanks for the upvote! I think step 3 is very specific and not always needed for the upgrade itself. Also I think, `rbenv local 3.0.0` would do the same? – Rich Steinmetz Mar 19 '21 at 06:41
  • Ubuntu 22.04/rbenv 1.02, there's no `plugins` directory, only `shims` and `versions`. – ggorlen Jul 17 '23 at 18:28
  • @ggorlen--onLLMstrike thx - i have updated instructions – BenKoshy Jul 18 '23 at 00:49
7

On Ubuntu

Short answer:

# You need to update the available versions via ruby-build
~ git -C ~/.rbenv/plugins/ruby-build pull
~ rbenv install 3.0.0
...
Installed ruby-3.0.0 to ~/.rbenv/versions/3.0.0

Long answer with a beautiful picture: https://richstone.io/where-is-ruby-3-0-0-on-rbenv/

Rich Steinmetz
  • 1,020
  • 13
  • 28