# Make .exe file by rubyscript2exe with no DOS?

**URL:** <https://www.ruby-forum.com/t/make-exe-file-by-rubyscript2exe-with-no-dos/136067>\
**Category:** Ruby\
**Created:** [April 28, 2008, 5:51pm UTC](https://www.ruby-forum.com/t/make-exe-file-by-rubyscript2exe-with-no-dos/136067 "2008-04-28T17:51:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![blitzer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/ecae2f/32.png) [@blitzer](https://www.ruby-forum.com/u/blitzer)\
**Post date:** [April 28, 2008, 5:51pm UTC](https://www.ruby-forum.com/t/make-exe-file-by-rubyscript2exe-with-no-dos/136067/1 "2008-04-28T17:51:56Z")

</div>

I have fallow this  
[http://www.ruby-forum.com/topic/84263](http://www.ruby-forum.com/topic/84263)

I can make file.exe that can run normally by use

> rubyscript2exe new/

new/ is my folder that contain data (image etc…)

and then I want to make it run without DOS I try

> rubyscript2exe new/ --rubyscript2exe-rubyw

It can make .exe file but when I click on it, it nothing happen… what  
I’m doing wrong 😢

---

<div class="post-metadata">

**Author:** ![blitzer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/ecae2f/32.png) [@blitzer](https://www.ruby-forum.com/u/blitzer)\
**Post date:** [April 28, 2008, 9:12pm UTC](https://www.ruby-forum.com/t/make-exe-file-by-rubyscript2exe-with-no-dos/136067/2 "2008-04-28T21:12:23Z")

</div>

Pat K. wrote:

> I have fallow this  
> [Re: Question: Ruby application packaging - Ruby - Ruby-Forum](http://www.ruby-forum.com/topic/84263)
> 
> I can make file.exe that can run normally by use
> 
> > rubyscript2exe new/
> 
> new/ is my folder that contain data (image etc…)
> 
> and then I want to make it run without DOS I try
> 
> > rubyscript2exe new/ --rubyscript2exe-rubyw
> 
> It can make .exe file but when I click on it, it nothing happen… what  
> I’m doing wrong 😢

Example:  
test.rb - It’s your file.  
and you want test.rb to test.exe yes?

It’s easy:

> rubyscript2exe test.rb test.exe

---

<div class="post-metadata">

**Author:** ![blitzer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/ecae2f/32.png) [@blitzer](https://www.ruby-forum.com/u/blitzer)\
**Post date:** [April 29, 2008, 1:48am UTC](https://www.ruby-forum.com/t/make-exe-file-by-rubyscript2exe-with-no-dos/136067/3 "2008-04-29T01:48:21Z")

</div>

my file is many picture and I want to make to exe for run in other  
computer so I put all file in ‘/new’ unless It can make only .rb to exe  
and can’t show picture. I can make .exe now but I will pop up DOS and I  
don’t want it. I want to know how to do :’(

---

<div class="post-metadata">

**Author:** ![blitzer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/ecae2f/32.png) [@blitzer](https://www.ruby-forum.com/u/blitzer)\
**Post date:** [April 29, 2008, 3:32am UTC](https://www.ruby-forum.com/t/make-exe-file-by-rubyscript2exe-with-no-dos/136067/4 "2008-04-29T03:32:24Z")

</div>

-----BEGIN PGP SIGNED MESSAGE-----  
Hash: SHA1

Pat K. wrote:  
| my file is many picture and I want to make to exe for run in other  
| computer so I put all file in ‘/new’ unless It can make only .rb to exe  
| and can’t show picture. I can make .exe now but I will pop up DOS and I  
| don’t want it. I want to know how to do 😢  
|

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

As Luka pointed out, you want the --rubyscript2exe-rubyw switch.

* * *

Phillip G.  
Twitter: [twitter.com/cynicalryan](http://twitter.com/cynicalryan)

~ I imagine bugs and girls have a dim perception that nature played a  
cruel trick on them, but they lack the intelligence to really comprehend  
the magnitude of it. – Calvin  
-----BEGIN PGP SIGNATURE-----  
Version: GnuPG v1.4.8 (MingW32)  
Comment: Using GnuPG with Mozilla - [http://enigmail.mozdev.org](http://enigmail.mozdev.org)

iEYEARECAAYFAkgWen0ACgkQbtAgaoJTgL+6NACdEUsl4xoZwO9iqcmVFzYHOJS6  
5VcAoKDM9ZqypIucaeeDzsMURrLMCkXj  
=F1bt  
-----END PGP SIGNATURE-----

---

<div class="post-metadata">

**Author:** ![blitzer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/ecae2f/32.png) [@blitzer](https://www.ruby-forum.com/u/blitzer)\
**Post date:** [April 29, 2008, 9:51am UTC](https://www.ruby-forum.com/t/make-exe-file-by-rubyscript2exe-with-no-dos/136067/5 "2008-04-29T09:51:22Z")

</div>

Pat K. wrote:

> I try
> 
> > rubyscript2exe new/ --rubyscript2exe-rubyw
> 
> It can make new.exe but when I run this file. it’s nothing happen :’(

Try creating it with --rubyscript2exe-ruby and running in it a DOS box  
first to see if it raises an exception.

Also, you should ensure that your script doesn’t call “puts” or similar  
as this may cause errors with the -rubyw switch, because the output is  
closed.

a

---

<div class="post-metadata">

**Author:** ![blitzer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/ecae2f/32.png) [@blitzer](https://www.ruby-forum.com/u/blitzer)\
**Post date:** [April 29, 2008, 8:22am UTC](https://www.ruby-forum.com/t/make-exe-file-by-rubyscript2exe-with-no-dos/136067/6 "2008-04-29T08:22:37Z")

</div>

I try

> rubyscript2exe new/ --rubyscript2exe-rubyw

It can make new.exe but when I run this file. it’s nothing happen :’(

---

<div class="post-metadata">

**Author:** ![blitzer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/ecae2f/32.png) [@blitzer](https://www.ruby-forum.com/u/blitzer)\
**Post date:** [April 29, 2008, 11:37am UTC](https://www.ruby-forum.com/t/make-exe-file-by-rubyscript2exe-with-no-dos/136067/7 "2008-04-29T11:37:03Z")

</div>

Alex F. wrote:

> Pat K. wrote:
> 
> > I try
> > 
> > > rubyscript2exe new/ --rubyscript2exe-rubyw
> > 
> > It can make new.exe but when I run this file. it’s nothing happen :’(
> 
> Try creating it with --rubyscript2exe-ruby and running in it a DOS box  
> first to see if it raises an exception.
> 
> Also, you should ensure that your script doesn’t call “puts” or similar  
> as this may cause errors with the -rubyw switch, because the output is  
> closed.
> 
> a

my code has some “puts” in other files that I require it. I will delete  
it and try again. thank you 🙂
