Wednesday, July 2, 2014

Making #! Work in Windows

#! (shabang) is a unix feature that does not automatically work on Windows but it can be made to work.

Change the path in the second command to point to the ruby you wish to run. Run these commands as administrator
$ assoc .rb=RubyScript
$ ftype RubyScript="c:\ruby\bin\ruby.exe" "%1" %*
(see the example at the bottom of the wikibooks Ruby helloworld )