2013-05-13 75 views
46

我已經安裝了Ruby 2.0與Windows Ruby安裝程序,解壓縮DevKit(DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe)到Program Files和跑無法正確自動生成Ruby DevKit配置文件

ruby dk.rb init 

但生成的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 
# 
--- 

如何使dk.rb產生有效config.yml

+1

我也遇到同樣的問題。然而,如果你說的是真的,根據[開發工具包維基](https://github.com/oneclick),你已經將開發工具包解壓縮到一個空格**(Program Files)的目錄**中/ ruby​​installer /維基/開發,工具包)。 – 2013-06-17 12:38:13

+0

如果你只是想安裝DevKit,而不是剃掉犛牛讓它自動生成'config.yml',你可以手動編輯'config.yml'來添加' - C:/ Ruby200' (或者你的安裝位置是什麼)'ruby dk.rb install'之前。 – Phrogz 2014-09-17 15:51:37

回答

92

看來問題在於,Ruby 2.0.0的64位版本在Devkit initilisation腳本(dk.rb)不知道的位置創建註冊表項('Software \ Wow6432Node \ RubyInstaller \ MRI' )。

在更新Devkit安裝程序之前,您可以通過在文本編輯器中打開%DevKitExtractionDir%\ dk.rb並更改REG_KEYS陣列以包含64位註冊表路徑,以使其看起來像這樣:

REG_KEYS = [ 
    'Software\RubyInstaller\MRI', 
    'Software\RubyInstaller\Rubinius', 
    'Software\Wow6432Node\RubyInstaller\MRI' 
] 
+3

在更新dk.rb之後,確保通過'ruby dk.rb init'重新生成config.xml。 – magiccrafter 2015-12-11 14:13:21

+5

經過將近3年的時間,這個問題和答案仍然得到了一些...這個小錯誤真的很難修復? – Paul 2016-03-03 20:00:01

27

Ruby on rails devkit windows

在config.yml的絕對路徑的前破折號是我所需要的。

- C:/Ruby.... 

另外提一下,Ruby和的devkit都特意設在我的C盤的根目錄,以避免在「程序文件」文件夾白色空間的問題。

+0

謝謝,對我有用 – 2014-01-11 00:37:18

+3

問題不在於如何手動編輯'config.yml',而是如何讓它自動生成**有效的'config.yml'。 – Paul 2014-04-28 05:54:21

4

編輯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 
# 
---