Stefan Lang said:
>
> require 'rbconfig'
> ruby = File.join(Config::CONFIG["bindir"],
>            Config::CONFIG["RUBY_INSTALL_NAME"])

I think you will also need EXEEXT:

require 'rbconfig'
ruby = File.join(Config::CONFIG["bindir"],
            Config::CONFIG["RUBY_INSTALL_NAME"]+
            Config::CONFIG["EXEEXT"])

Ryan