Rvm Determine and Install Latest Version of Ruby

How to know the lastest version of ruby in Terminal?

rvm get head # update list of known rubies. Necessary if your local list is out of date.
rvm install ruby --latest # install the latest ruby

The latest ruby version (at time of writing) is 2.4.0

Install and use the latest version of Ruby

You can do

rvm use ruby --latest --default

RVM, where is Ruby 3.0.0?

If you have not updated rvm do that first RVM Upgrading

rvm get stable 
# or
rvm get master # for even newer versions not in stable 3.0.0 in this case

To see all available rubies run

rvm list remote all 
# or
rvm list known # as pointed out in the comments

you should see ruby-3.0.0 in the list of available rubies

Then run

rvm install ruby-3.0.0

How can I update Ruby version 2.0.0 to the latest version in Mac OS X v10.10 (Yosemite)?

Open your terminal and run

curl -sSL https://raw.githubusercontent.com/rvm/rvm/master/binscripts/rvm-installer | bash -s stable

When this is complete, you need to restart your terminal for the rvm command to work.

Now, run rvm list known

This shows the list of versions of the Ruby interpreter.

Now, run rvm install ruby@latest to get the latest Ruby version.

If you type ruby -v in the terminal, you should see ruby X.X.X.

If it still shows you ruby 2.0., run rvm use ruby-X.X.X --default.

Prerequisites for Windows 10:

  • C compiler. You can use http://www.mingw.org/
  • make command available otherwise it will complain that "bash: make: command not found". You can install it by running mingw-get install msys-make
  • Add "C:\MinGW\msys\1.0\bin" and "C:\MinGW\bin" to your path environment variable

What's the right string to use when installing Ruby 3.1 through RVM on Mac OS Big Sur?

> rvm list known
# MRI Rubies
[ruby-]1.8.6[-p420]
[ruby-]1.8.7[-head] # security released on head
[ruby-]1.9.1[-p431]
[ruby-]1.9.2[-p330]
[ruby-]1.9.3[-p551]
[ruby-]2.0.0[-p648]
[ruby-]2.1[.10]
[ruby-]2.2[.10]
[ruby-]2.3[.8]
[ruby-]2.4[.10]
[ruby-]2.5[.8]
[ruby-]2.6[.6]
[ruby-]2.7[.2]
[ruby-]3[.0.0]
ruby-head

3.1 doesn't seem to be on the list, but to install it you would use:

> rvm install ruby-3.1.0

or

> rvm install 3.1.0

But again, doesn't seem available, at least in rvm stable or latest. Looking at GitHub, they have merged patches to add 3.1 support but the latest releases don't list it: https://github.com/rvm/rvm/releases.

Find latest available RVM version number

you could use this one liner to check version:

$ curl -sS  https://api.github.com/repos/wayneeseguin/rvm/git/refs/tags | awk -F": |\"" '$2=="ref"{sub(/.*\//,"",$5); print $5}' | sort -V | tail -n 1
1.15.8

or a pure ruby one liner:

$ ruby -ropen-uri -rjson -e 'open("https://api.github.com/repos/wayneeseguin/rvm/git/refs/tags"){|r| puts JSON.parse(r.read).map{|l| l["ref"].gsub(/.*\//,"").split(".").map(&:to_i)}.sort.last.join(".") }'
1.15.8

but the simplest thing to do is:

$ curl https://raw.github.com/wayneeseguin/rvm/stable/VERSION
1.15.8

Installing Ruby on Linux

  • Update your package manager first:

    sudo apt-get update
  • This must finish without error or the following step will fail.
    Install curl:

    sudo apt-get install curl
  • You’ll use curl for installing RVM.

  • Install RVM

    curl -L https://get.rvm.io | bash -s stable --ruby
  • You Already Have RVM Installed
    If you already have RVM installed, update it to the latest version and install Ruby:

    rvm get stable --autolibs=enable
  • Install Ruby:

    rvm install ruby

How do I upgrade my ruby 1.9.2-p0 to the latest patch level using rvm?

First of all, update your RVM installation by running rvm get stable.

To make sure you're running the new RVM version, you'll then need to run rvm reload (or just open a new terminal).

Once that's done, you can ask RVM to list the ruby versions available to install by running rvm list known.

In the output you should now see:

# MRI Rubies
...
[ruby-]1.9.2[-p320]
...

The square brackets around the patch level indicate that this is currently RVM's default patch level for ruby 1.9.2.

Finally, to install the new ruby version, just run rvm install 1.9.2 - and wait for it to compile!



Related Topics



Leave a reply



Submit