如何检查安装在我的 Windows 中的 Ruby 开发工具包的版本?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17789667/
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 22:21:44  来源:igfitidea点击:

How to check version of Ruby dev kit installed in my Windows?

ruby-on-railsrubywindows

提问by Jitendra Vyas

Ruby dev kit isinstalled in my Windows 7. How can I check whether it's 32 bit or 64 bit and version number

我的 Windows 7 中安装了Ruby 开发工具包。如何检查它是 32 位还是 64 位和版本号

I'm not asking How to check ruby version which is ruby -v

我不是在问如何检查 ruby​​ 版本 ruby -v

回答by qqbenq

On the 32 bit vs 64 bit part:

在 32 位与 64 位部分:

ruby -e "puts 1.size"

The 32 bit version would yield 4, the 64 bit version 8. (This is the size of a FixNumin bytes.)

32 位版本将产生464 位版本8。(这是 a 的大小(FixNum以字节为单位)。)

回答by BeardedCoder

Apparently the answer is that there is no way to get the version of DevKit (according to this post on the Google groups for RubyInstaller). To paraphrase that posting, because it is not an installer it doesn't present version information. It would appear the only way to know for sure is to dig up the original zip file used to install it.

显然,答案是无法获得 DevKit 的版本(根据 RubyInstaller谷歌组上的这篇文章)。解释一下那个帖子,因为它不是安装程序,它不提供版本信息。似乎确定知道的唯一方法是挖掘用于安装它的原始 zip 文件。

回答by laitart

Starting with Ruby 2.4.0 the MSYS2 toolchain is used as development kit. (Learn more at https://rubyinstaller.org/downloads/)

从 Ruby 2.4.0 开始,MSYS2 工具链用作开发工具包。(在https://rubyinstaller.org/downloads/了解更多信息)

There's no command I'm aware of that would return if MSYS2 is installed / or how to check its version. What you can do:

如果安装了 MSYS2/或如何检查其版本,我知道没有任何命令会返回。你可以做什么:

To check if MSYS2 was a part of your installation:

要检查 MSYS2 是否是您安装的一部分:

  1. Check your installation file's name, for example rubyinstaller-devkit-2.5.1-1-x64. Like here, if the devkitis in the name, it means it might be installed.
  2. Go to your installed programs, and find for Ruby, for me it's Ruby 2.5.1-1-x64 with MSYS2.
  1. 检查安装文件的名称,例如rubyinstaller-devkit-2.5.1-1-x64. 像这里,如果devkit名称中有 ,则表示它可能已安装。
  2. 转到您安装的程序,找到 Ruby,对我来说是Ruby 2.5.1-1-x64 with MSYS2.

To check if MSYS2 has been actually installed:

要检查 MSYS2 是否已实际安装:

  1. If there is msys64catalog in your Ruby installation folder, it means that's MSYS2 is there.

  2. In order to check which version is installed, open Command Prompt and run the following line C:\Ruby25-x64\msys64\mingw64\bin>gcc --version(within the proper directory on your computer of course).

    That's what I can see:

    gcc (Rev2, Built by MSYS2 project) 7.3.0 Copyright (C) 2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

  1. 如果msys64您的 Ruby 安装文件夹中有目录,则意味着 MSYS2 就在那里。

  2. 为了检查安装了哪个版本,打开命令提示符并运行以下行C:\Ruby25-x64\msys64\mingw64\bin>gcc --version(当然在您计算机上的正确目录中)。

    这就是我能看到的:

    gcc (Rev2, Built by MSYS2 project) 7.3.0 Copyright (C) 2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I used the following tip > check the platform of the installed mingw, 32bit or 64 bit

我使用了以下提示 >检查安装的 mingw 的平台,32 位或 64 位

回答by user9445251

Use ruby -v in command prompt. if it shows the version installed on the system. then it means Ruby is installed on your system.

在命令提示符中使用 ruby​​ -v。如果它显示系统上安装的版本。那么这意味着你的系统上安装了 Ruby。

ex :

前任 :

C:\Users\abhilash>ruby -v
ruby 2.4.3p205 (2017-12-14 revision 61247) [x64-mingw32]

回答by dliggat

I've never done any kind of ruby development in Windows, but that being said, you should be able to run the ruby command line binary with the --versionflag:

我从未在 Windows 中进行过任何类型的 ruby​​ 开发,但话虽如此,您应该能够使用以下--version标志运行 ruby​​ 命令行二进制文件:

$ ruby --version
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin12.1.0]