3

rbenv doesn't show the newer versions of Ruby.
Various guides say to update ruby build but I don't have the ruby-build directory set up to do that in my installation.

What should I do?

Michael Durrant
  • 93,410
  • 97
  • 333
  • 497

1 Answers1

9

Follow these steps:

# confirm version NOT available
$ rbenv install --list | grep 2.6.2
# Nothing shows up

$ git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build

$ rbenv install --list | grep 2.6.2
2.6.2 # <-- Now it shows up !

Now that version can be installed locally

$ rbenv install 2.6.2
$ ruby -v
$ ruby 2.6.2p47

One final step I had to do was

$ bundle # -> this gave an error "You must use Bundler 2 or greater with this lockfile."
$ gem install bundler:2.0.1

Finally, a

$ bundle

for a project with a .ruby-version file of 2.6.2 will work !

Michael Durrant
  • 93,410
  • 97
  • 333
  • 497
  • And after you do the initial setup of `ruby-build`, you can update it by running `git pull origin master` from the `~/.rbenv/plugins/ruby-build` directory anytime you want to get newer versions. – Oleksii Filonenko May 20 '19 at 18:30