Ruby-on-rails 如何配置 config.yml 以便我可以安装 devkit?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20810653/
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
How do I configure config.yml so that I can install devkit?
提问by user3141089
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\Aaron>cd /DevKit
The system cannot find the path specified.
C:\Users\Aaron>cd \DevKit
C:\DevKit>ruby dk.rb init
Initialization complete! Please review and modify the auto-generated
'config.yml' file to ensure it contains the root directories to all
of the installed Rubies you want enhanced by the DevKit.
C:\DevKit>ruby dk.rb install --force
Invalid configuration or no Rubies listed. Please fix 'config.yml'
and rerun 'ruby dk.rb install'
C:\DevKit>
The config.yml looks like this:
config.yml 看起来像这样:
# 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
#
---
I am completely stumped I have no clue what to do. Can someone tell me how to resolve this problem?
我完全被难住了,我不知道该怎么办。有人能告诉我如何解决这个问题吗?
回答by dudewad
Yeah I don't think it could possibly be more vague. Basically, it's asking for one reference to your ruby installation. Mine lives in my Program Files directory since I prefer to keep all installed stuff in one spot, rather than straight on the C drive like is default (I'm on windows). So, since my Ruby installation path is: C:\Program Files\Ruby200-x64
是的,我不认为它可能更模糊。基本上,它要求提供一份对您的 ruby 安装的参考。我的位于我的 Program Files 目录中,因为我更喜欢将所有安装的东西放在一个地方,而不是像默认的那样直接放在 C 驱动器上(我在 Windows 上)。所以,由于我的 Ruby 安装路径是:C:\Program Files\Ruby200-x64
My entireconfig.yml file is the following:
我的整个config.yml 文件如下:
# 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 # --- - "C:/Program Files/Ruby200-x64"
Note, I put my Ruby filepath in quotes because it contains a space. If your path doesn't contain a space, then you won't need it.
请注意,我将 Ruby 文件路径放在引号中,因为它包含一个空格。如果您的路径不包含空格,那么您将不需要它。
I can see this being colossally confusing for a lot of people, so I hope this helps.
我可以看到这让很多人感到非常困惑,所以我希望这会有所帮助。
updateI'm seeing that spaces in file paths causes issues, so I've moved mine back down to the c:\ drive just because I don't want to deal with it. I recommend staying away from spaces in file paths unless you're willing to troubleshoot issues down the line.
更新我看到文件路径中的空格会导致问题,所以我将我的移动回 c:\ 驱动器只是因为我不想处理它。我建议远离文件路径中的空格,除非您愿意解决问题。
回答by Dudo
So... that file is asking you to point to your ruby installation.
所以...该文件要求您指向您的 ruby 安装。
for me... mine looked like:
对我来说......我的看起来像:
- C:\RailsInstaller\Ruby2.0.0
回答by Aida
Write your path to ruby installation folder The pattern is three dashes then move to next line Add another dash, space and path
写入 ruby 安装文件夹的路径模式是三个破折号然后移动到下一行添加另一个破折号、空格和路径
---
- C:\Ruby21-x64
(Since you can see three dashes have already been put at the end of your config.yml file so you basically need to add the last line)
(因为你可以看到 config.yml 文件末尾已经放了三个破折号,所以你基本上需要添加最后一行)
回答by GoAntonio
watch out of blank spaces! My problem was this maybe can be yours too !
注意空格!我的问题是这也可能是你的!
回答by Mustafa Yousef
You have to use slashes "/" instead of backslashes "\" on windows. Worked for me on Win7x64
您必须在 Windows 上使用斜杠“/”而不是反斜杠“\”。在 Win7x64 上对我来说有效

