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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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” %*