I use ruby 1.8.6 and ruby-gnome2 I can run by Scite with it work
normally. But when I make to .exe by follow this
== 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
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:
p0 = Pathname.new(RUBYSCRIPT2EXE.appdir)
root_runtime = p0.parent.to_s
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
If someone thinks it's a useful addtion to the Hiki, could someone
add it (or give me a password)? Thanks!
I can’t run .exe file!!! please see my picture for problem :’(