From: Hal E. Fulton [mailto:hal9000@hypermetrics.com]
From: “Brian D. Baker” baker.921@osu.edu
Hal E. Fulton wrote:
At the command line, that is.
Problem: When you run a .rb file from the
command line, you have to type a (potentially
lengthy) command.Run msconfig from Start Menu->Run. Under the “Environment” tab of
the
program that opens, there is a variable called PATH. The value of
path
is a semicolon delimited list of directories. Add C:\RUBY\BIN (or
whatever directory holds ruby.exe on your computer) to the PATH
variable
and apply the changes. You might have to restart, but you won’t have
to
type the full path to ruby ever again!Thanks. I’m well familiar with PATH. But I don’t
like typing this sort of thing:ruby -Ithis -Ithat -Ithe_other myprog.rb
But I don’t want to put everything in RUBYLIB,
either.Basically I was trying to
- Just type “myprog”
- Get Windows to honor the #! line
- Avoid the problems with batch files
I know: I should just run Linux all the time…
Look up the assoc and ftype commands and the pathext environment
variable. (It will let you type just myprog, you don’t even have to type
myprog.rb )
– bjorn