Search code examples
rubyrbenv

Where does rbenv install ruby?


I installed ruby 2.7.1 using rbenv.

How can I find where on Mac OS that version of ruby is located?

Note: I need its location for updating the PATH

Also note: which ruby returns /usr/bin/ruby (the old version)


Solution

  • Rbenv by itself does not install Ruby implementations at all. You simply give it the path to an already installed Ruby implementation.

    There are several projects that make installing Ruby implementations easier. One of those is the ruby-build project, which also provides an optional plugin for Rbenv that provides an rbenv install subcommand. This plugin will typically install Ruby implementations in ~/.rbenv/versions/*, but that is configurable.

    Note, however, that it is generally not required that you set up the $PATH yourself. rbenv init can do that for you, and it knows the correct path anyway, so you don't have to think about it.