如何在 Windows 中更新 ruby

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15722703/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-02 21:43:13  来源:igfitidea点击:

How to update ruby in windows

ruby-on-railsrubyruby-on-rails-4

提问by user2202706

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

我通过 rails 安装程序下载了 ruby​​,但我现在想要 ruby​​ 2.0.0 并且已经下载了它。我如何更新我的红宝石,因为我这样做

ruby -v

ruby -v

it still comes up as ruby version 1.9.3.

它仍然显示为 ruby​​ 版本 1.9.3。

采纳答案by Luís Ramalho

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.

对您来说最简单的方法可能是使用 RubyInstaller,它的 2.0.0-p0 版本现在可以作为安装程序下载。点击链接http://rubyinstaller.org/了解更多信息。

回答by sokkyoku

I recommend using Chocolatey to manage your ruby installation.

我建议使用 Chocolatey 来管理您的 ruby​​ 安装。

It's a unix style package manager for windows.

它是一个用于 Windows 的 Unix 风格的包管理器。

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

安装非常简单,你可以在他们的网站上找到说明。

In cmd.exe (run as administrator):

在 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:

然后你可以安装ruby:

choco install ruby

And upgrade it later:

并稍后升级:

choco upgrade ruby

回答by Vivek Panday

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

您可以使用新的安装程序或使用“gem”(ruby 包管理器)进行更新。