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?
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!
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
Rbenv is usually installed with it's companion ruby-build
You can get the versions available to be installed with:
ruby-build --definitions
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.
To see all available versions:
rbenv install --list-all
Or
rbenv install --list
To list only stable releases for each Ruby implementation.
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
ruby-build --definitions
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:
Also, you may need to brew upgrade
if you have installed with brew see here.