# When i using "rubyscript2exe", occur error

**URL:** <https://www.ruby-forum.com/t/when-i-using-rubyscript2exe-occur-error/107777>\
**Category:** Ruby\
**Created:** [June 26, 2007, 3:49am UTC](https://www.ruby-forum.com/t/when-i-using-rubyscript2exe-occur-error/107777 "2007-06-26T03:49:39Z")\
**Posts on this page:** 6\
**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 26, 2007, 3:49am UTC](https://www.ruby-forum.com/t/when-i-using-rubyscript2exe-occur-error/107777/1 "2007-06-26T03:49:39Z")

</div>

When i using the “rubyscript2exe”, there occur error. Because i cannot  
use any picture in the project. How can i put picture in my project that  
no error after built the .exe file???

---

<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 26, 2007, 1:41pm UTC](https://www.ruby-forum.com/t/when-i-using-rubyscript2exe-occur-error/107777/2 "2007-06-26T13:41:43Z")

</div>

Cool W. wrote:

> When i using the “rubyscript2exe”, there occur error. Because i cannot  
> use any picture in the project. How can i put picture in my project that  
> no error after built the .exe file???

Embed the image in your executable using:

RUBYSCRIPT2EXE.bin = [‘my\_image.jpg’]

For complete details, see:

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

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 26, 2007, 3:46pm UTC](https://www.ruby-forum.com/t/when-i-using-rubyscript2exe-occur-error/107777/3 "2007-06-26T15:46:36Z")

</div>

> > When i using the “rubyscript2exe”, there occur error.  
> > Because i cannot use any picture in the project. How can i  
> > put picture in my project that no error after built the  
> > .exe file???
> 
> Embed the image in your executable using:
> 
> RUBYSCRIPT2EXE.bin = [‘my\_image.jpg’]

Aagh!!! Unless the image happens to be an executable as well…

gegroet,  
Erik V. - [http://www.erikveen.dds.nl/](http://www.erikveen.dds.nl/)

---

<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 26, 2007, 4:05pm UTC](https://www.ruby-forum.com/t/when-i-using-rubyscript2exe-occur-error/107777/4 "2007-06-26T16:05:38Z")

</div>

Do you have windows xp or vista?

2007/6/26, Erik V. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<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 26, 2007, 3:59pm UTC](https://www.ruby-forum.com/t/when-i-using-rubyscript2exe-occur-error/107777/5 "2007-06-26T15:59:38Z")

</div>

> When i using the “rubyscript2exe”, there occur error. Because  
> i cannot use any picture in the project. How can i put  
> picture in my project that no error after built the .exe  
> file???

Which error?

If you want to embed images and other files, see the example  
below, and read the documentation on the site.

gegroet,  
Erik V. - [http://www.erikveen.dds.nl/](http://www.erikveen.dds.nl/)

* * *

# Example on Cygwin:

$ ls -l hw/  
total 2  
-rw-r–r-- 1 erik mkgroup-l-d 13 Jun 26 14:58 README  
-rw-r–r-- 1 erik mkgroup-l-d 161 Jun 26 15:19 init.rb

$ cat hw/init.rb  
require “rubyscript2exe”  
exit if RUBYSCRIPT2EXE.is\_compiling?  
puts File.read(RUBYSCRIPT2EXE.appdir(“README”))

$ ruby rubyscript2exe.rb hw/  
Tracing hw …  
Gathering files…  
Copying files…  
Creating hw.exe …

$ ./hw.exe  
Hello World!

---

<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 26, 2007, 6:00pm UTC](https://www.ruby-forum.com/t/when-i-using-rubyscript2exe-occur-error/107777/6 "2007-06-26T18:00:54Z")

</div>

> Do you have windows xp or vista?

Both.

gegroet,  
Erik V.
