Hi, 

From: Lothar Scholz <mailinglists / scriptolutions.com>
Subject: Re: [ANN] **RC2** Ruby Installer for Windows 1.8.2-14 Release Candidate
Date: Thu, 8 Jul 2004 04:50:28 +0900
Message-ID: <1206233312.20040707215023 / scriptolutions.com>

> The Ruby Installer still conflicts with because the TCL_LIBRARY is set
> to a value that python can't handle (python needs TCL 8.4).
> 
> I think this is a show stopper bug.
> 
> I really get angry every time i install Ruby and can't access "idle"
> (which is Python's standard IDE) anymore.
> 
> Can you please patch the main function in rubys "main.c" file
> until the tk maintainer fixes this in the right place.

I'll modify Init_tcltklib() of tcltklib.c such like the following.

==================================================================
RCS file: /var/cvs/src/ruby/ext/tcltklib/tcltklib.c,v
retrieving revision 1.49.2.5
diff -u -r1.49.2.5 tcltklib.c
--- tcltklib.c  1 Jul 2004 09:38:38 -0000       1.49.2.5
+++ tcltklib.c  8 Jul 2004 03:06:51 -0000
@@ -5133,6 +5133,11 @@
 }
 #endif
 
+
+/* RUBYTK_xxx=v1, xxx=v2 --> xxx=v1, X_RUBYTK_xxx=v2 */
+static char *convertRubyTkEnvVarScript = "ENV.keys.each{|k| if (k=~/^RUBYTK_(.*)/) then kc=$1; kx='X_RUBYTK_'+kc; if ENV.key?(kc)&&!ENV.key?(kx) then ENV[kx]=ENV[kc] end; ENV[kc]=ENV[k]; ENV.delete(k) end}";
+
+
 /*---- initialization ----*/
 void
 Init_tcltklib()
@@ -5145,6 +5150,10 @@
     VALUE ev_flag = rb_define_module_under(lib, "EventFlag");
     VALUE var_flag = rb_define_module_under(lib, "VarAccessFlag");
 
+    /* --------------------------------------------------------------- */
+
+    rb_eval_string(convertRubyTkEnvVarScript);
+    
     /* --------------------------------------------------------------- */
 
 #if defined USE_TCL_STUBS && defined USE_TK_STUBS
==================================================================

As you see in the patch, when require 'tcltklib', environment variables 
which starts 'RUBYTK_' replace to the one removed 'RUBYTK_' (e.g. 
RUBYTK_TCL_LIBRARY --> TCL_LIBRARY).
If the target enviromnent variable already exists and the backup 
variable does not exist (it means that to make backup is only once), 
the backup variable are make (e.g. TCL_LIBRARY --> X_RUBYTK_TCL_LIBRARY). 

Can it satisfy you? :-)
-- 
                                  Hidetoshi NAGAI (nagai / ai.kyutech.ac.jp)