# Rubyscript2exe / hiki

**URL:** <https://www.ruby-forum.com/t/rubyscript2exe-hiki/84494>\
**Category:** Ruby-Gnome 2\
**Created:** [February 5, 2007, 10:31am UTC](https://www.ruby-forum.com/t/rubyscript2exe-hiki/84494 "2007-02-05T10:31:06Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Emmanuel\_T](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/c5a1d2/32.png) [@Emmanuel\_T](https://www.ruby-forum.com/u/Emmanuel_T)\
**Post date:** [February 5, 2007, 10:31am UTC](https://www.ruby-forum.com/t/rubyscript2exe-hiki/84494/1 "2007-02-05T10:31:06Z")

</div>

Hello,

```
Currently it is not easy to use rubyscript2exe to make an EXE

```

containing a ruby-gtk2 application on win32.  
on the ruby-gnome2 site, there is a HOWTO:  
[http://ruby-gnome2.sourceforge.jp/hiki.cgi?tips\_rubyscript2exe](http://ruby-gnome2.sourceforge.jp/hiki.cgi?tips_rubyscript2exe)

```
But it is really complicated, requires touching your ruby directory,

```

your ruby application, and personally I didn’t succeed in making it  
work. I wanted to update that page, adding a second solution I managed  
to make work. Here is the text that I wrote for the Hiki (before I  
realised I need a login to write on it):

* * *

== rubyscript2exe on Windows, solution 2

Another solution is to copy all the needed files inside the temporary  
directory created by rubyscript2exe, each time the application starts.  
You put all the needed GTK files and folders in a subfolder of your  
source code, and copy those files in the rubyscript2exe directory at  
startup. That way, you don’t have to touch your ruby installation or  
make it possible to run your ruby program from any folder.

Let’s create a “run\_dep” folder under the folder where you have the  
source code of your application.  
In that folder, copy the etc/, lib/ and share/ from your GTK  
installation. The GTK installation is in c:\gtk or C:\Program  
Files\Common Files\GTK\2.0. You can safely remove the “doc” and  
“gtk-doc” subfolders of the “share”, to save some space.  
In share\locale, you can remove the locales you don’t need if you want,  
to save more space (locales take ~20Mb). You can remove all the contents  
of the share\locale folder if you want, the english/US is always  
shipped.  
For me, I could also remove \*.lib in lib (10Mb), and lib\locale (15Mb).

Then, add the following lines at the start of your main .rb file:

require ‘rubyscript2exe’  
require ‘fileutils’  
require ‘pathname’

p0 = Pathname.new(RUBYSCRIPT2EXE.appdir)  
root\_runtime = p0.parent.to\_s  
begin  
FileUtils.cp\_r(‘run\_dep/.’, root\_runtime)  
rescue  
end

Those lines copy all the files & folders inside the “run\_dep” folder to  
the folder where rubyscript2exe will extract your application. The  
begin/rescue is needed because that fails when you run your application  
the first time in rubyscript2exe, to create the .exe.

Regenerate your application, and run the exe… it should work now!

## In the end, to ship my application I need 6Mb exe and 1.26Mb “run\_dep”, plus the glade files. And it seems no GTK installation is needed on the target computer!

```
If someone thinks it's a useful addtion to the Hiki, could someone

```

add it (or give me a password)? Thanks!

emmanuel

* * *

Using Tomcat but need to do more? Need to support web services,  
security?  
Get stuff done quickly with pre-integrated technology to make your job  
easier.  
Download IBM WebSphere Application Server v.1.0.1 based on Apache  
Geronimo  
[http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642](http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642)

---

<div class="post-metadata">

**Author:** ![Emmanuel\_T](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/c5a1d2/32.png) [@Emmanuel\_T](https://www.ruby-forum.com/u/Emmanuel_T)\
**Post date:** [February 20, 2007, 4:56pm UTC](https://www.ruby-forum.com/t/rubyscript2exe-hiki/84494/2 "2007-02-20T16:56:19Z")

</div>

Hi!

I’m glad this project was born.  
I’ve tried experimenting, and run into the following:

I have GTK 2.10.6 runtime environment

I’ve installed ruby 185-21 one click installer.  
I’ve installed ruby-gnome with GTK and without registering environment  
variables.

I’ve created an executable following your description.  
However, I copied the files from your gtk bin, which is in a ruby  
subfolder.

Then I ran the exe, and get a nasty: entry point not found in dll.  
Not closing that dialog, and peeking into $TEMP, I realized, that the  
dlls of MY gtk runtime environment was used.

Did I do something wrong?

Gergo

–  
±[Gergely K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) ]------------------+  
| |  
| Mobile:(+36 20)356 9656 |  
| |  
± “Olyan lángész vagyok, hogy poroltóval kellene járnom!” -+

* * *

Take Surveys. Earn Cash. Influence the Future of IT  
Join [SourceForge.net](http://SourceForge.net)’s Techsay panel and you’ll get the chance to share  
your  
opinions on IT & business topics through brief surveys-and earn cash  
[http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV](http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV)

---

<div class="post-metadata">

**Author:** ![Emmanuel\_T](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/c5a1d2/32.png) [@Emmanuel\_T](https://www.ruby-forum.com/u/Emmanuel_T)\
**Post date:** [February 20, 2007, 8:00pm UTC](https://www.ruby-forum.com/t/rubyscript2exe-hiki/84494/3 "2007-02-20T20:00:39Z")

</div>

Gergo,

Not sure of your exact problem, but you might try this thread for ideas:  
[http://sourceforge.net/mailarchive/message.php?msg\_id=14765482](http://sourceforge.net/mailarchive/message.php?msg_id=14765482)

Curtis

Gergely K. wrote:

> 

* * *

Take Surveys. Earn Cash. Influence the Future of IT  
Join [SourceForge.net](http://SourceForge.net)’s Techsay panel and you’ll get the chance to share  
your  
opinions on IT & business topics through brief surveys-and earn cash  
[http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV](http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV)

---

<div class="post-metadata">

**Author:** ![Emmanuel\_T](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/c5a1d2/32.png) [@Emmanuel\_T](https://www.ruby-forum.com/u/Emmanuel_T)\
**Post date:** [February 21, 2007, 10:38am UTC](https://www.ruby-forum.com/t/rubyscript2exe-hiki/84494/4 "2007-02-21T10:38:11Z")

</div>

Hello,

Ah, you’re using the “run\_dep” method, not the first one, i thought you  
were using the first one. I wrote the FAQ about the run\_dep method, so  
I’ll answer that.

> WITH gtk runtime, without setting PATH

Just a note: when I used the run\_dep method, I installed the GTK from  
gladewin32 as suggested by the ruby-gnome2 developers, and installed  
ruby-gtk2 through the ZIP not the installer. So our different setups are  
probably the reason why it doesn’t work for you. But I don’t understand  
why right now.  
The code that you added to the main ruby application is pretty  
transparent: it copies the GTK DLLs that you put in run\_dep to the  
temporary directory where your application will run. Normally when using  
that method, the EXE will run even if GTK is not installed on the target  
computer, however you must ship the run\_dep folder with the EXE.

What exactly appears in the folder where the application is running?  
which files are present?

emmanuel

PS: maybe we can continue that conversation in private mail, so that we  
don’t send too much on the list

* * *

Take Surveys. Earn Cash. Influence the Future of IT  
Join [SourceForge.net](http://SourceForge.net)’s Techsay panel and you’ll get the chance to share  
your  
opinions on IT & business topics through brief surveys-and earn cash  
[http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV](http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV)

---

<div class="post-metadata">

**Author:** ![Emmanuel\_T](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/c5a1d2/32.png) [@Emmanuel\_T](https://www.ruby-forum.com/u/Emmanuel_T)\
**Post date:** [February 21, 2007, 10:25am UTC](https://www.ruby-forum.com/t/rubyscript2exe-hiki/84494/5 "2007-02-21T10:25:09Z")

</div>

Hi!

Thanks for the reply.

I’ve searched for iconv.dll, and all have the same size.

So I’ll try to explain more elaborate.

To reproduce the problem:

1. Install gtk runtime 2.10.6 from here  
[http://gimp-win.sourceforge.net/stable.html](http://gimp-win.sourceforge.net/stable.html)
2. Install ruby 185-21
3. Install ruby-gnome2 from here  
[Download ruby-gnome2-0.16.0-1-i386-mswin32.exe (Ruby-GNOME 2)](http://prdownloads.sourceforge.net/ruby-gnome2/ruby-gnome2-0.16.0-1-i386-mswin32.exe?download)  
WITH gtk runtime, without setting PATH
4. Create a hello world app
5. copy under run\_dep the folders mentioned from the ruby dir
6. run rubyscript2exe (app starts correctly)
7. run the freshly created exe
8. do not press ok to the error dialog
9. locate your app in $TEMP and compare the mentioned dll with the one  
in the ruby dir. They’ll differ.

If I understand correctly the guide, ruby should always find the  
installed gtk in the ruby-gnome2 package. But this is not the case.

On 2/20/07, Curtis S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > However, I copied the files from your gtk bin, which is in a ruby subfolder.

–  
±[Gergely K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) ]------------------+  
| |  
| Mobile:(+36 20)356 9656 |  
| |  
± “Olyan lángész vagyok, hogy poroltóval kellene járnom!” -+

* * *

Take Surveys. Earn Cash. Influence the Future of IT  
Join [SourceForge.net](http://SourceForge.net)’s Techsay panel and you’ll get the chance to share  
your  
opinions on IT & business topics through brief surveys-and earn cash  
[http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV](http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV)

---

<div class="post-metadata">

**Author:** ![Emmanuel\_T](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/c5a1d2/32.png) [@Emmanuel\_T](https://www.ruby-forum.com/u/Emmanuel_T)\
**Post date:** [February 21, 2007, 12:08pm UTC](https://www.ruby-forum.com/t/rubyscript2exe-hiki/84494/6 "2007-02-21T12:08:23Z")

</div>

Hello,

> Ok, removed the other GTK, and letting ruby-gnome2-s GTK set the  
> environment variable solves this problem.
> 
> The next one is the problem with pango:
> 
> (app starts, but letters are squares ☹

So, after off-list discussion with Gergely K., we discovered that  
having GTK installed from the GIMP installer causes problems with that  
method of using rubyscript2exe. The solution is not to have GTK  
installed from the gimp-win32 project; you can run GIMP with no problems  
with the gladewin32 GTK.

I updated the rubyscript2exe wiki page with that text:

> Note: that method will work if the target computer has no GTK  
> installed or the gladewin32 GTK. If the user installed the GTK that  
> comes with gimp for windows, it will not work, because that version of  
> GTK will be used instead of the one that comes with your program, and  
> that version does not work well. In that case, the best is for the  
> user to uninstall that special version of GTK and use the gladewin32  
> version, which works fine with GIMP (and GAIM) on windows, and allows  
> running such ruby-gtk2 programs.  
> emmanuel

* * *

Take Surveys. Earn Cash. Influence the Future of IT  
Join [SourceForge.net](http://SourceForge.net)’s Techsay panel and you’ll get the chance to share  
your  
opinions on IT & business topics through brief surveys-and earn cash  
[http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV](http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV)

---

<div class="post-metadata">

**Author:** ![Emmanuel\_T](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/c5a1d2/32.png) [@Emmanuel\_T](https://www.ruby-forum.com/u/Emmanuel_T)\
**Post date:** [February 21, 2007, 10:39am UTC](https://www.ruby-forum.com/t/rubyscript2exe-hiki/84494/7 "2007-02-21T10:39:11Z")

</div>

Ok, removed the other GTK, and letting ruby-gnome2-s GTK set the  
environment variable solves this problem.

The next one is the problem with pango:

(app starts, but letters are squares ☹

Creating runs fine, but when I try to execute the exe I get:  
t:/tmp/eee.hello.exe.2/lib/rubygems/custom\_require.rb: line 27  
Pango-WARNING \*\*:No builtin or dynamically  
loaded modules were found. Pango will not work correctly.  
This probably means there was an error in the creation of:  
‘t:\tmp\eee.hello.exe.2\etc\pango\pango.modules’  
You should create this file by running pango-querymodules.  
t:/tmp/eee.hello.exe.2/lib/rubygems/custom\_require.rb: line 27  
Pango-WARNING \*\*:pango\_shape called with bad font, expect ugly output  
t:/tmp/eee.hello.exe.2/lib/rubygems/custom\_require.rb: line 27  
Pango-WARNING \*\*:pango\_font\_get\_glyph\_extents called with bad font,  
expect ug  
ly output  
t:/tmp/eee.hello.exe.2/lib/rubygems/custom\_require.rb: line 27  
Pango-WARNING \*\*:pango\_font\_get\_font\_map called with bad font, expect  
ugly ou  
tput  
t:/tmp/eee.hello.exe.2/lib/rubygems/custom\_require.rb: line 27  
Pango-CRITICAL \*\*:\_pango\_cairo\_font\_map\_get\_renderer: assertion  
`PANGO_IS_CAI RO_FONT_MAP (fontmap)' failed t:/tmp/eee.hello.exe.2/lib/rubygems/custom_require.rb: line 27 Pango-WARNING **:_pango_cairo_font_install called with bad font, expect ugly output t:/tmp/eee.hello.exe.2/lib/rubygems/custom_require.rb: line 27 Pango-CRITICAL** :_pango_cairo_font_map_get_renderer: assertion `PANGO\_IS\_CAI  
RO\_FONT\_MAP (fontmap)’ failed  
t:/tmp/eee.hello.exe.2/lib/rubygems/custom\_require.rb: line 27  
Pango-CRITICAL \*\*:\_pango\_cairo\_font\_map\_get\_renderer: assertion  
`PANGO_IS_CAI RO_FONT_MAP (fontmap)' failed t:/tmp/eee.hello.exe.2/lib/rubygems/custom_require.rb: line 27 Pango-CRITICAL **:_pango_cairo_font_map_get_renderer: assertion `PANGO\_IS\_CAI  
RO\_FONT\_MAP (fontmap)’ failed  
t:/tmp/eee.hello.exe.2/lib/rubygems/custom\_require.rb: line 27  
Pango-CRITICAL \*\*:\_pango\_cairo\_font\_map\_get\_renderer: assertion  
`PANGO_IS_CAI RO_FONT_MAP (fontmap)' failed t:/tmp/eee.hello.exe.2/lib/rubygems/custom_require.rb: line 27 Pango-CRITICAL **:_pango_cairo_font_map_get_renderer: assertion `PANGO\_IS\_CAI  
RO\_FONT\_MAP (fontmap)’ failed  
t:/tmp/eee.hello.exe.2/lib/rubygems/custom\_require.rb: line 27  
Pango-CRITICAL \*\*:\_pango\_cairo\_font\_map\_get\_renderer: assertion  
`PANGO\_IS\_CAI  
RO\_FONT\_MAP (fontmap)’ failed

–  
±[Gergely K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) ]------------------+  
| |  
| Mobile:(+36 20)356 9656 |  
| |  
± “Olyan lángész vagyok, hogy poroltóval kellene járnom!” -+

* * *

Take Surveys. Earn Cash. Influence the Future of IT  
Join [SourceForge.net](http://SourceForge.net)’s Techsay panel and you’ll get the chance to share  
your  
opinions on IT & business topics through brief surveys-and earn cash  
[http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV](http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV)

---

<div class="post-metadata">

**Author:** ![Emmanuel\_T](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/c5a1d2/32.png) [@Emmanuel\_T](https://www.ruby-forum.com/u/Emmanuel_T)\
**Post date:** [February 22, 2007, 12:58am UTC](https://www.ruby-forum.com/t/rubyscript2exe-hiki/84494/8 "2007-02-22T00:58:09Z")

</div>

Thanks, the problem is solved (workaround), I installed the  
gladewin32’s gtk, and it works with GIMP also.  
And Emmanuel updated the FAQ.  
It seems that ruby-gnome2’s gtk is not used, if it is not on the PATH.

On 2/22/07, Masao M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > (app starts, but letters are squares ☹
> 
> [http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV](http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV)
> 
> * * *
> 
> ruby-gnome2-devel-en mailing list  
> removed\_email\_address@domain.invalid  
> [ruby-gnome2-devel-en List Signup and Options](https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en)

–  
±[Gergely K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) ]------------------+  
| |  
| Mobile:(+36 20)356 9656 |  
| |  
± “Olyan lángész vagyok, hogy poroltóval kellene járnom!” -+

* * *

Take Surveys. Earn Cash. Influence the Future of IT  
Join [SourceForge.net](http://SourceForge.net)’s Techsay panel and you’ll get the chance to share  
your  
opinions on IT & business topics through brief surveys-and earn cash  
[http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV](http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV)

---

<div class="post-metadata">

**Author:** ![Emmanuel\_T](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/c5a1d2/32.png) [@Emmanuel\_T](https://www.ruby-forum.com/u/Emmanuel_T)\
**Post date:** [February 22, 2007, 12:16am UTC](https://www.ruby-forum.com/t/rubyscript2exe-hiki/84494/9 "2007-02-22T00:16:33Z")

</div>

Hi,

On Wed, 21 Feb 2007 10:38:44 +0100  
“Gergely K.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> loaded modules were found. Pango will not work correctly.  
> You need to run GTK/bin/reconfig.bat first.  
> It makes the configuration files where the modules are.

I don’t have any knowhow about rubyscript2exe …,

If it includes all of c:\ruby and extract it a new tempolary directory,  
you need to call (the new directory/lib/GTK/bin/reconfig.bat), before  
executing ruby program.

HTH,

* * *

Take Surveys. Earn Cash. Influence the Future of IT  
Join [SourceForge.net](http://SourceForge.net)’s Techsay panel and you’ll get the chance to share  
your  
opinions on IT & business topics through brief surveys-and earn cash  
[http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV](http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV)

---

<div class="post-metadata">

**Author:** ![Emmanuel\_T](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/c5a1d2/32.png) [@Emmanuel\_T](https://www.ruby-forum.com/u/Emmanuel_T)\
**Post date:** [April 16, 2007, 2:11pm UTC](https://www.ruby-forum.com/t/rubyscript2exe-hiki/84494/10 "2007-04-16T14:11:30Z")

</div>

I am encountering the exact problem the Gergely encountered but the  
solutions that were previously mentioned are not working. I installed  
gladeWin32 from  
[http://gladewin32.sourceforge.net/modules/news/](http://gladewin32.sourceforge.net/modules/news/) and I followed the  
directions mentioned by Emmanuel to no avail. Does anyone know of any  
other reason this would happen?

Gergely K. wrote:

> Thanks, the problem is solved (workaround), I installed the  
> gladewin32’s gtk, and it works with GIMP also.  
> And Emmanuel updated the FAQ.  
> It seems that ruby-gnome2’s gtk is not used, if it is not on the PATH.
> 
> On 2/22/07, Masao M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > > (app starts, but letters are squares ☹
> > 
> > [http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV](http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV)
> > 
> > * * *
> > 
> > ruby-gnome2-devel-en mailing list  
> > removed\_email\_address@domain.invalid  
> > [ruby-gnome2-devel-en List Signup and Options](https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en)
> 
> –  
> ±[Gergely K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) ]------------------+  
> | |  
> | Mobile:(+36 20)356 9656 |  
> | |  
> ± “Olyan lï¿½ngï¿½sz vagyok, hogy poroltï¿½val kellene jï¿½rnom!” -+
> 
> * * *
> 
> Take Surveys. Earn Cash. Influence the Future of IT  
> Join [SourceForge.net](http://SourceForge.net)’s Techsay panel and you’ll get the chance to share  
> your  
> opinions on IT & business topics through brief surveys-and earn cash  
> [http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV](http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV)
