Ruby on Windows

Tips for using Ruby on Windows.

Command-Line Scripts

Unlike Linux which uses the hash-bang (#!) convention and the executable file permission flag to determine is a file in the path can be executed and how it should be execute, Windows does not provide such a convenient method.

The Ruby One-Click installer will provide the necessary file associations needed to run Ruby scripts by double-clicking them. Essentially these are entries in the registry that indicate which program to use to “open” a file.

This association also works when using the command line (cmd.exe, or command.exe). The we also though want the ability to run our scripts without having to use the file extension; basically being able to type “myscript” instead of “myscript.rb”.

This can be achieved by editing the PATHEXT environment variable and adding ”;.rb” to the end of it.

projects/ruby/on_windows.txt · Last modified: 2008/07/09 11:39 by martinsgill
Firefox 3 Mandriva Linux National Secular Society Humanism Lib Dems