[wxruby-users] wxRuby & RubyScript2exe

Jay McGavren jay at mcgavren.com
Fri Mar 28 15:28:16 EDT 2008


Matthew Webb wrote:
> Bitmap file does not exist:
> C:\Users\Matthew\eee\eee.controls.exe.4\app/icons/list.xpm
> (ArgumentError)
>
> Do you have any ideas how I could solve this problem?

The problem is that this script depends on an external file, which
rubyscript2exe doesn't include in the .exe (and therefore not in the
eee temp folder).  You'll need to employ a little cleverness to
include the resource with the executable.

This page talks about including library files for another GUI
framework in the .exe, and should be adaptable for including resource
files:

http://ruby-gnome2.sourceforge.jp/hiki.cgi?tips_rubyscript2exe

> 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.

You'll of course need to modify the path referenced in the script such
that it points to the temp location that the resource gets
decompressed to.

BTW, overall wxRuby works *beautifully* with rubyscript2exe, which is
one of my favorite features about it.

-Jay McGavren


More information about the wxruby-users mailing list