From: Luis Lavena Date: 2010-11-01T13:30:58+09:00 Subject: Re: What does ruby.exe do? On Oct 31, 11:51 pm, Kaye Ng wrote: > Rajinder Yadav wrote in post #958380: > > > On 10-10-30 05:34 AM, Kaye Ng wrote: > >> it onto ruby.exe ? > > >> Thanks geniuses. > > > just put "C:\Ruby192\bin" at the end of your path environment, open up > > cmd.exe in the folder where the example lives, and then type > > > 'ruby.exe example1.rb' > > May I ask why 'ruby.exe example1.rb' when 'example1.rb' alone is > sufficient? > beginner here =) no knowledge whatsoever. > That only works if during installation of Ruby you check the box to associate .rb and .rbw files with the interpreter. You can also type 'ruby ex' and hit tab to get the filename autocompleted ;-) > but I was just wondering why you suggested that.  is it a conventional > way or something?  I'm still not sure why ruby.exe exists in the bin > folder, I find testing programs in command prompt a lot easier....and i > don't feel like using SciTE.exe (text editor) either.... > Normally speaking is good to invoke scripts with "ruby" before since it works across platforms. Some scripts for certain projects will not have .rb extension and the system will not be able to determine what to do with them. ruby.exe exist because it is the Ruby interpreter. If you remove it your way of invoking the script (example1.rb) will not work. -- Luis Lavena