# How to make .exe file?

**URL:** <https://www.ruby-forum.com/t/how-to-make-exe-file/107094>\
**Category:** Ruby\
**Created:** [June 18, 2007, 3:21am UTC](https://www.ruby-forum.com/t/how-to-make-exe-file/107094 "2007-06-18T03:21:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![coolwong](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/d9b06d/32.png) [@coolwong](https://www.ruby-forum.com/u/coolwong)\
**Post date:** [June 18, 2007, 3:21am UTC](https://www.ruby-forum.com/t/how-to-make-exe-file/107094/1 "2007-06-18T03:21:44Z")

</div>

I using RUBYSCRIPT2EXE to built an .exe file for my project. After i  
install RUBYSCRIPT2EXE gem, but i do not know how to built an .exe file.  
Any one can teach me with sample code???

---

<div class="post-metadata">

**Author:** ![coolwong](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/d9b06d/32.png) [@coolwong](https://www.ruby-forum.com/u/coolwong)\
**Post date:** [June 18, 2007, 3:59am UTC](https://www.ruby-forum.com/t/how-to-make-exe-file/107094/2 "2007-06-18T03:59:34Z")

</div>

Cool W. wrote:

> I using RUBYSCRIPT2EXE to built an .exe file for my project. After i  
> install RUBYSCRIPT2EXE gem, but i do not know how to built an .exe file.  
> Any one can teach me with sample code???

Quick example, on Windows:

Include the following in your script:

require “rubyscript2exe”  
exit if RUBYSCRIPT2EXE.is\_compiling?

If this is a console app, save your script with a “.rb” extension. If it  
is a non-console app, save your script with a “.rbw” extension (ie,  
“my\_app.rbw”).

Open a console/command window and enter:

rubyscript2exe my\_app.rbw

Further details here:

[http://www.erikveen.dds.nl/rubyscript2exe/index.html#3.1.0](http://www.erikveen.dds.nl/rubyscript2exe/index.html#3.1.0)

David

> **[Ruby on Windows](http://rubyonwindows.blogspot.com)**
>
> On using the Ruby programming language on the Microsoft Windows platform

---

<div class="post-metadata">

**Author:** ![coolwong](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/d9b06d/32.png) [@coolwong](https://www.ruby-forum.com/u/coolwong)\
**Post date:** [June 18, 2007, 9:17am UTC](https://www.ruby-forum.com/t/how-to-make-exe-file/107094/3 "2007-06-18T09:17:39Z")

</div>

i can do it already, thank u so much.

---

<div class="post-metadata">

**Author:** ![coolwong](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/d9b06d/32.png) [@coolwong](https://www.ruby-forum.com/u/coolwong)\
**Post date:** [June 18, 2007, 4:48am UTC](https://www.ruby-forum.com/t/how-to-make-exe-file/107094/4 "2007-06-18T04:48:18Z")

</div>

David M. wrote:

> Cool W. wrote:
> 
> > I using RUBYSCRIPT2EXE to built an .exe file for my project. After i  
> > install RUBYSCRIPT2EXE gem, but i do not know how to built an .exe file.  
> > Any one can teach me with sample code???
> 
> Quick example, on Windows:
> 
> Include the following in your script:
> 
> require “rubyscript2exe”  
> exit if RUBYSCRIPT2EXE.is\_compiling?
> 
> If this is a console app, save your script with a “.rb” extension. If it  
> is a non-console app, save your script with a “.rbw” extension (ie,  
> “my\_app.rbw”).
> 
> Open a console/command window and enter:
> 
> rubyscript2exe my\_app.rbw
> 
> Further details here:
> 
> [http://www.erikveen.dds.nl/rubyscript2exe/index.html#3.1.0](http://www.erikveen.dds.nl/rubyscript2exe/index.html#3.1.0)
> 
> David
> 
> [http://rubyonwindows.blogspot.com](http://rubyonwindows.blogspot.com)

when i write the “require ‘rubyscript2exe’”, it will be true. but after  
i continue the rubyscript2exe, it cannot run and occur error.

```auto
"require 'rubyscript2exe'

RUBYSCRIPT2EXE testing.rb"
```

it shown :“undefined local variable or method `testing’ for main:Object  
(NameError)”

where i need to correct???
