48

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

ruby dk.rb init

but the generated config.yml file doesn't list my Ruby path. Its contents looks as follows:

# 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?

Paul
  • 25,812
  • 38
  • 124
  • 247
  • 1
    I am also experiencing the same problem. If what you say is true, however, you have extracted the devkit to a directory **with spaces** (Program Files) which will not work, according to the [Development Kit Wiki](https://github.com/oneclick/rubyinstaller/wiki/Development-Kit). – Dr.Seuss Jun 17 '13 at 12:38
  • If you are just trying to install the DevKit, instead of shaving the yak to get it to auto-generate the `config.yml` correctly you can just hand-edit `config.yml` to add `- C:/Ruby200` (or whatever your install location is) before `ruby dk.rb install`. – Phrogz Sep 17 '14 at 15:51

3 Answers3

95

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').

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:

REG_KEYS = [
    'Software\RubyInstaller\MRI',
    'Software\RubyInstaller\Rubinius',
    'Software\Wow6432Node\RubyInstaller\MRI'
]
Dr.Seuss
  • 1,598
  • 3
  • 16
  • 20
  • 3
    And after the dk.rb is updated make sure to regenerate the config.xml via `ruby dk.rb init` – magiccrafter Dec 11 '15 at 14:13
  • 5
    After nearly 3 years this question and answer are still getting points... Is it really hard to fix this minor bug? – Paul Mar 03 '16 at 20:00
28

Ruby on rails devkit windows

The dash in front of the absolute path in the config.yml was all i needed.

- 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.

Community
  • 1
  • 1
sledgeweight
  • 7,685
  • 5
  • 31
  • 45
  • 3
    The question was not about how to edit `config.yml` manually, but how to make it **generate** valid `config.yml` automatically. – Paul Apr 28 '14 at 05:54
4

Edit the config.yml file and give the path of your Ruby directory something as follow

# 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
#
--- 
Virat Gaywala - CSM
  • 657
  • 1
  • 8
  • 11