Coexistency Problem: cygwin + Ruby for Window (and suggestion for improving the Ruby installer)



I just would like to point out a problem when installing Ruby for
Windows
and Cygwin on the same system:

The installer of the Windows version of Ruby creates - at least on
systems
using a keyboard with European layout - a file named inputrc.euro in the

bin directory of Ruby. As far I can tell, interactive Ruby tools (that
is:
irb) are using the file (via readline.dll) to access characters such as
'[' or '}', which need to be accessed using the 'AltGr' modifier on
European
keyboards. In order that readline.dll can find this configuration file,
the
environment variable INPUTRC on the system is silently set to this path.

This causes problems when the Cygwin package is also installed. Cygwin
installs
on the desktop an icon to launch a window running the bash shell, and
bash
also comes with its version of readline. The standard for all readline
programs
requires that, if the environment variable INPUTRC is set to some valid
file name,
that file is read for customizations; if this environment variable is
NOT set,
but the file $HOME/.inputrc exists, *that* file is read customizations.
In every
other case, readline is not customized and uses just its default
behaviour.

A Cygwin user customizes therefore the readline behaviour by editing
inputrc
in his/her home directory. But when Ruby for Windows is installed, bash
(when
started) sees that the environment variable INPUTRC exists, but does not
point to a valid file (because the windows syntax for specifying a file
path
is not valid in Cygwin), and bypasses the definitions in ~/.inputrc.

The only workaround I can think of, goes like this: Instead of using the
standard
Cygwin way to launch a Cygwin bash shell from the desktop (this goes via
a batch
file cygwin.bat), one can write his own Cygwin-bash-startup file, which
unsets
INPUTRC before calling bash.

However, Cygwin users don't expect that other systems "under the hood"
change the
Windows environment in such a way. I therefore suggest that either

(1) the installer for Windows Ruby points out in the installation
dialogue explicitly
that it is changing the Windows environment by inserting a variable
INPUTRC (and Cygwin
users will then at least know what is going on), or

(2) those Batch files in the Ruby distribution, which need INPUTRC, set
the environment
locally. Of course this would mean that the installation program has to
"rewrite" those
files (such as irb.bat) to contain the necessary "set
INPUTRC=C:\MYRUBYDIR\bin\inputrc.euro".

Any opinions on that matter?


Ronald
--
Ronald Fischer <ronald.fischer@xxxxxxxxxx>
Phone: +49-89-452133-162


.



Relevant Pages

  • Re: Yet another Windows installer
    ... Windows as far as I am concerned. ... Writing ruby is quite easy so ... "I don't really need the One-Click Installer anymore, ... some point, that would be IronRuby, since it comes from Microsoft. ...
    (comp.lang.ruby)
  • Re: Speed issue on Windows
    ... Linux and XP Professional, and I've got CygWin on the Windows side. ... CygWin Ruby, Curt Hibbs' One Click and the stock Gentoo ...
    (comp.lang.ruby)
  • [ANN] Bootstrapping Ruby with MinGW: selfhosted and test sandbox!
    ... get a working Ruby implementation using MinGW. ... of One-Click Installer for Windows. ... You'll require to download sources of your favorite gems. ...
    (comp.lang.ruby)
  • Windows Ruby (was Re: Zed Shaw - Ruby has dodged a bullet)
    ... Not only do I have to buy VMWare, a copy of Windows, and go through ... Microsoft has a Ruby product in the works, ... but both are true open source environments. ... loading Cygwin and using the Cygwin pre-compiled Ruby. ...
    (comp.lang.ruby)
  • One-Click Installer for Ruby 1.8.7?
    ... the Windows platform? ... installer for the old version 1.8.6. ... You've supplied a binary version of 1.8.7 for Windows, ... errors I previously described while testing ruby 1.9.0 on Windows ...
    (comp.lang.ruby)