无法正确自动生成 Ruby DevKit 配置文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16523607/
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
Can't get Ruby DevKit configuration file autogenerated properly
提问by Paul
I've installed Ruby 2.0 with a Windows Ruby Installer, Unpacked DevKit (DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe) to Program Files and ran
我已经使用 Windows Ruby 安装程序安装了 Ruby 2.0,解压 DevKit (DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe) 到 Program Files 并运行
ruby dk.rb init
but the generated config.ymlfile doesn't list my Ruby path. Its contents looks as follows:
但生成的config.yml文件没有列出我的 Ruby 路径。其内容如下:
# This configuration file contains the absolute path locations of all
# installed Rubies to be enhanced to work with the DevKit. This config
# file is generated by the 'ruby dk.rb init' step and may be modified
# before running the 'ruby dk.rb install' step. To include any installed
# Rubies that were not automagically discovered, simply add a line below
# the triple hyphens with the absolute path to the Ruby root directory.
#
# Example:
#
# ---
# - C:/ruby19trunk
# - C:/ruby192dev
#
---
How to make dk.rb to generate valid config.yml?
如何使 dk.rb 生成有效config.yml?
回答by Dr.Seuss
It seems the problem is that that the 64bit version of Ruby 2.0.0 creates a registry entry in a location that the Devkit initilisation script (dk.rb) is not aware of ('Software\Wow6432Node\RubyInstaller\MRI').
问题似乎在于 64 位版本的 Ruby 2.0.0 在 Devkit 初始化脚本 (dk.rb) 不知道的位置('Software\Wow6432Node\RubyInstaller\MRI')创建了一个注册表项。
Until the Devkit installer is updated, you can get the installation to work by opening %DevKitExtractionDir%\dk.rb in a text editor and changing the REG_KEYS array to include the 64-bit registry path, so it looks like this:
在 Devkit 安装程序更新之前,您可以通过在文本编辑器中打开 %DevKitExtractionDir%\dk.rb 并更改 REG_KEYS 数组以包含 64 位注册表路径来使安装工作,因此它看起来像这样:
REG_KEYS = [
'Software\RubyInstaller\MRI',
'Software\RubyInstaller\Rubinius',
'Software\Wow6432Node\RubyInstaller\MRI'
]
回答by racemic
The dash in front of the absolute path in the config.yml was all i needed.
config.yml 中绝对路径前面的破折号就是我所需要的。
- C:/Ruby....
Also to mention, Ruby and Devkit are both purposely located in the root of my C drive to avoid the issue with white spaces in the 'Program Files' folder.
还要提一下,Ruby 和 Devkit 都特意位于我的 C 驱动器的根目录中,以避免出现“Program Files”文件夹中的空格问题。
回答by Virat Gaywala - CSM
Edit the config.ymlfile and give the path of your Ruby directory something as follow
编辑config.yml文件并给出 Ruby 目录的路径,如下所示
# This configuration file contains the absolute path locations of all
# installed Rubies to be enhanced to work with the DevKit. This config
# file is generated by the 'ruby dk.rb init' step and may be modified
# before running the 'ruby dk.rb install' step. To include any installed
# Rubies that were not automagically discovered, simply add a line below
# the triple hyphens with the absolute path to the Ruby root directory.
#
# Example:
#
# ---
- C:/ruby21-x64
# - C:/ruby192dev
#
---

