Possible Duplicate:
How to I launch a ruby script from the command line by just its name?
Currently I am using:
ruby test.rb
But want to run it on command prompt as:
test
How could I do that?
Possible Duplicate:
How to I launch a ruby script from the command line by just its name?
Currently I am using:
ruby test.rb
But want to run it on command prompt as:
test
How could I do that?
Follow the instructions available here:
At the command prompt (i.e. shell prompt), run the following Windows commands. When you run ftype, change the command-line arguments to correctly point to where you installed the ruby.exe executable on your computer.
$ assoc .rb=RubyScript
.rb=RubyScript
$ ftype RubyScript="c:\ruby\bin\ruby.exe" "%1" %*
RubyScript="c:\ruby\bin\ruby.exe" "%1" %*
You can make your .rb files open with ruby interpreter.
All done. Now you can run scripts using just their names. Alternatively, you can also run them by simply double clicking.