50

I have installed rbenv in my vagrant machine but when I try to list all the available ruby versions rbenv versions then it gives me this output:

system (set by /home/vagrant/.rbenv/version)

Does anyone know what is this?

leppie
  • 115,091
  • 17
  • 196
  • 297
vivek
  • 2,807
  • 5
  • 31
  • 44

7 Answers7

85

Are you asking what the output of that command means? I'm looking at the rbenv documentation, and I think it indicates that rbenv only knows of one version of ruby - the version that came installed with your system.

Edit: If that's not the answer you were looking for, can you tell us what you expected to see? Did you have other versions installed on that machine?

Edit 2: If you want to see a list of versions you can install onto your machine, but aren't installed yet, run:

rbenv install --list

Here is more documentation for this command. This will help!

CliffordVienna
  • 7,995
  • 1
  • 37
  • 57
hlh
  • 1,992
  • 15
  • 24
  • Hmm, I want to look at all the available ruby versions from which I can chose the desired one to install. I don't remember but last time I ran some command which gave me a list of all the ruby versions and from that I chose `1.9.3-p0` – vivek May 01 '13 at 19:54
  • Okay, I think are looking for a different command, then. Rbenv is listing all of the ruby versions that are currently on your machine. See my edit. – hlh May 01 '13 at 20:01
  • 2
    It would be much simpler for rbenv to have an `rbenv list` command – stevec Mar 25 '19 at 17:04
  • Currently only `rbenv install --list-all` will show all versions available for installation – Nico Brenner Dec 22 '21 at 21:08
53

If you have tried both rbenv install --list and ruby-build --definitions and still can't see the latest Ruby versions on the list, then you need to upgrade ruby-build because that is what rbenv uses to "know" the available versions.

For example, assuming you use Mac OS X and installed ruby-build using Homebrew, you can update ruby-build by invoking:

brew upgrade ruby-build

Now, try listing the available versions again, and you should see the latest ones there.

Edit:

The ruby-build wiki lists a couple of ways of updating it, namely the above one using Homebrew and another one where it is installed as a plugin to rbenv:

cd "$(rbenv root)"/plugins/ruby-build && git pull
Jarno Lamberg
  • 1,530
  • 12
  • 12
20

Rbenv is usually installed with it's companion ruby-build

You can get the versions available to be installed with:

ruby-build --definitions
Unixmonkey
  • 18,485
  • 7
  • 55
  • 78
19

To get a list of available ruby versions you can install, type the following:

rbenv install -l

To get a list of the ruby versions already installed on your machine, type the following:

rbenv versions


To answer your question as to what the below means:

system (set by /home/vagrant/.rbenv/version)

This is telling you that the system ruby (the default ruby installed on your system) is the only ruby version installed on your vagrant machine. Rbenv is using the default system ruby because it doesn't have any other ruby versions installed yet.

James
  • 608
  • 6
  • 11
6

To see all available versions:

rbenv install --list-all

Or

rbenv install --list

To list only stable releases for each Ruby implementation.

betoharres
  • 1,736
  • 2
  • 19
  • 25
  • Only `rbenv install --list-all` will list available versions to install – Nico Brenner Dec 22 '21 at 21:07
  • ``rbenv install --list`` is for stable releases only, it's stated at the end of the command output: ```Only latest stable releases for each Ruby implementation are shown. Use 'rbenv install --list-all / -L' to show all local versions.``` – betoharres Jan 09 '22 at 04:22
3

If you are on Mac brew upgrade rbenv ruby-build also works. Documentation

Abhishek Sah
  • 88
  • 2
  • 8
3

List rbenv versions that are possible to install

"Only latest stable releases for each Ruby implementation are shown.

With the fewest key strokes (shorter than --list and --list-all)

rbenv install -l 

Want to see what is available from rbenv to install?

ruby-build --definitions

Want to narrow that down a bit?

ruby-build --definitions | grep 3.0

To upgrade to the latest rbenv and update ruby-build with newly released Ruby versions, upgrade the Homebrew packages:

brew update && brew upgrade rbenv ruby-build

Also you can always just type rbenv Which will give you a help menu

rbenv 

TLDR the manpage or github repo or just plain forgot?

Take a peek at this site for quick rbenv recollection:

https://devhints.io/rbenv

Also, you may need to brew upgrade if you have installed with brew see here.

jasonleonhard
  • 12,047
  • 89
  • 66
  • But this is useless without an updated `ruby-build`. – matt Apr 13 '21 at 22:14
  • Indeed. But it is not self _updating_. Thus merely calling `rbenv install -l` does not solve the original problem of finding out what ruby versions are available _now_. See my https://stackoverflow.com/questions/66129103/where-is-ruby-3-0-0-on-rbenv The point in general, though, is that this answer doesn't contribute anything that isn't already present in other answers. – matt Apr 13 '21 at 23:39