Search code examples
rubydevkit

Can't get Ruby DevKit configuration file autogenerated properly


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?


Solution

  • 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'
    ]