Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rvm determine and install latest version of ruby

Tags:

ruby

rvm

So far I only know how to do commands like

rvm 2.0.0

Fortunately Google tells me

The current stable version is 2.0.0-p247.

But shouldn't I be able to use rvm to do that step for me? I can't figure out how to just tell rvm to install the latest version of ruby, without manually specifying it.

like image 607
djechlin Avatar asked Jul 11 '13 16:07

djechlin


People also ask

How do I install a specific version of Ruby?

Use `gem install -v` You may already be familiar with gem install , but if you add the -v flag, you can specify the version of the gem to install. Using -v you can specify an exact version or use version comparators.

What is latest version of Ruby?

What is the latest Ruby version? Ruby 3.1. 0 is the Ruby latest version (3.1. 0 was released Dec 25, 2021).


2 Answers

it is enough to:

rvm get stable
rvm use ruby --install --default 

it will update rvm, check for latest ruby - install it if missing - and set as default

like image 66
mpapis Avatar answered Sep 18 '22 19:09

mpapis


I don't know of a way to have rvm just install the latest version automatically, but here's three simple commands using just rvm:

rvm reload
rvm list known # This will show all the available versions, including the latest
rvm install <latest_version> # Replace <latest_version> with the latest shown by the last command
like image 28
dsw88 Avatar answered Sep 21 '22 19:09

dsw88