# EXE in windows

**URL:** <https://www.ruby-forum.com/t/exe-in-windows/122576>\
**Category:** Ruby\
**Created:** [December 9, 2007, 7:15pm UTC](https://www.ruby-forum.com/t/exe-in-windows/122576 "2007-12-09T19:15:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dannypotta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/a9adbd/32.png) [@dannypotta](https://www.ruby-forum.com/u/dannypotta)\
**Post date:** [December 9, 2007, 7:15pm UTC](https://www.ruby-forum.com/t/exe-in-windows/122576/1 "2007-12-09T19:15:12Z")

</div>

I am new to Ruby (not to programming) and am trying to make executable  
files in Windows. The doc I am looking at only seems to have  
instructions for exe’s on unix/linux. Any advise on who to do this or  
whre to look to figure it out

* * *

[http://www.math.umd.edu/~dcarrera/ruby/0.3/chp\_01/programs.html](http://www.math.umd.edu/~dcarrera/ruby/0.3/chp_01/programs.html)  
Making programs executable  
If you are running Linux or Unix, you can make your Ruby programs  
executable, so they can be run like any other program.

First, you need to know where Ruby is installed in your system. Type  
‘which ruby’ on a terminal:

Precede this by ‘#!’ (pronounced “sharp bang”) and make that the very  
first line of your program.

Now you can type ‘chmod +x prog.rb’ to make the program executable (‘+x’  
means “executable”).

Warning: Make sure that you type this exactly and that it’s the very  
first line of your program.  
If there is a blank line above this one, this won’t work.  
If there is a space before the ‘#!’,this won’t work.

* * *

---

<div class="post-metadata">

**Author:** ![dannypotta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/a9adbd/32.png) [@dannypotta](https://www.ruby-forum.com/u/dannypotta)\
**Post date:** [December 9, 2007, 7:25pm UTC](https://www.ruby-forum.com/t/exe-in-windows/122576/2 "2007-12-09T19:25:49Z")

</div>

On Mon, Dec 10, 2007, Daniel P. wrote:

> I am new to Ruby (not to programming) and am trying to make executable  
> files in Windows. The doc I am looking at only seems to have  
> instructions for exe’s on unix/linux. Any advise on who to do this or  
> whre to look to figure it out

You’re almost certainly looking for rubyscript2exe

[http://www.erikveen.dds.nl/rubyscript2exe/](http://www.erikveen.dds.nl/rubyscript2exe/)

Ben

---

<div class="post-metadata">

**Author:** ![dannypotta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/a9adbd/32.png) [@dannypotta](https://www.ruby-forum.com/u/dannypotta)\
**Post date:** [December 9, 2007, 7:45pm UTC](https://www.ruby-forum.com/t/exe-in-windows/122576/3 "2007-12-09T19:45:44Z")

</div>

> Precede this by ‘#!’ (pronounced “sharp bang”) and make that the very  
> first line of your program.

On windows, you could also create a new filetype (eg .rbx) and  
associate  
it with ruby as the application that opens file with this extension.  
This would allow you to double-click on rbx-files.

A second solution besides rubyscript2exe is exerb[1]. The  
disadvantage  
with exerb is that, at least the last time I looked into it, only  
little  
documentation was available in English. Also I think that exerb works  
less well with complex compiled extensions but this could also be a  
now  
outdated misjudgment on my part resulting from a certain lack of  
accessible documentation.

Regards,  
Thomas.

[1] [http://raa.ruby-lang.org/project/exerb/](http://raa.ruby-lang.org/project/exerb/)
