How to update ruby in windows

2019-01-14 11:18发布

问题:

I downloaded ruby trhrough the rails installer but i now want ruby 2.0.0 and already downloaded it. how do i update my ruby because whe i do

ruby -v

it still comes up as ruby version 1.9.3.

回答1:

The easiest way for you might be to use RubyInstaller, which its version 2.0.0-p0 is now available for download as installers. Follow the link http://rubyinstaller.org/ for more information.



回答2:

I recommend using Chocolatey to manage your ruby installation.

It's a unix style package manager for windows.

It's quite easy to install, you can find instructions on their website.

In cmd.exe:

@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin

Then you can install ruby:

choco install ruby

And upgrade it later:

choco upgrade ruby


回答3:

Either You can go with new Installer or use "gem"(ruby package manager) to update.