Rubyscript2exe windows executables, on Linux

I’ve downloaded rubyscript2exe, and:

$ ruby rubyscript2exe.rb HelloWorld.rb

will create a file called HelloWorld_linux which runs on linux.

The problem is that I’m trying to make a single .exe for windows
users.

I rm -rf’d the script, and then used ruby gems to install
rubyscript2exe (although it was stored only on my /var partition and
had to be moved to my /usr/local/bin) and it produced the same result.

I don’t think you can do that. Try running it under Wine.

It bundles ruby.exe and friends into an executable package. Obviously
Linux systems do not contains ruby.exe. There are probably other issues
as well.

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

K. wrote:
| I’ve downloaded rubyscript2exe, and:
|
| $ ruby rubyscript2exe.rb HelloWorld.rb
|
| will create a file called HelloWorld_linux which runs on linux.
|
| The problem is that I’m trying to make a single .exe for windows
| users.
|
| I rm -rf’d the script, and then used ruby gems to install
| rubyscript2exe (although it was stored only on my /var partition and
| had to be moved to my /usr/local/bin) and it produced the same result.

Compile Ruby with the MinGW32 cross compiler tools. AS to how to obtain
it, check your distro (yum install mingw32-tools, or some such thing).

The wxWidgets (not the wxRuby folks!) have an entry on how to use
MinGW32 to compile a windows binary:

See http://wiki.wxwidgets.org/Cross-Compiling_Under_Linux


Phillip G.
Twitter: twitter.com/cynicalryan

~ The purpose of writing is to inflate weak ideas, obscure pure
reasoning, and
inhibit clarity. With a little practice, writing can be an intimidating
and
impenetrable fog! – Calvin
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkgBnY0ACgkQbtAgaoJTgL9VGQCgm/zKbRrtqB8dT5gXUaKJhCQo
0C0An1UBwn6YoYq6G2jswiyS6QCphjgd
=M/qF
-----END PGP SIGNATURE-----

On 13 Apr 2008, at 04:25, K. wrote:

rubyscript2exe (although it was stored only on my /var partition and
had to be moved to my /usr/local/bin) and it produced the same result.

If you alternately pack the executable using 7za.exe (from the extras
distribution) and p7zip, you can easily achieve this by compressing
and then:

cp 7za.exe myapp.exe
cat archive.7z >> myapp.exe

or on windows, use copy /b.

Sorry, I meant to post:

[email protected]:~$ ruby -v
ruby 1.8.5 (2006-08-25) [i486-linux]

Running Debian Etch.

I only have an 8GB HDD, so installing wine was a last resort, but
thanks for the help.

I don’t think you can do that. Try running it under Wine.

I actually think it is possible but I never tried it on my own.

After all, one can cross-compile on Linux, for a windows system.

So I am pretty confident that all this should work, but I never tried,
and would probably not manage anyway - but someone out there would
definitely manage :slight_smile:

On Mon, Apr 14, 2008 at 9:15 AM, K. [email protected] wrote:

Sorry, I meant to post:

[email protected]:~$ ruby -v
ruby 1.8.5 (2006-08-25) [i486-linux]

Running Debian Etch.

I only have an 8GB HDD, so installing wine was a last resort, but
thanks for the help.

I think it is possible to generate rubyscript2exe files on unix, BUT:
you’ll need to rewrite dependency collecting.
It works by running the program and collecting all required files
(including the dll files). Since most probably you cannot
run the script under windows, you have to collect the files manually.
[1] show the generated file structure.

If you solve this problem, please let Erik know about it. He might be
interested.

[1] http://www.erikveen.dds.nl/rubyscript2exe/#2.1.0

RubyScript2Exe can’t cross compile directly. However…

It’s possible to run Ruby for Windows on top of Wine on top of
Linux. And it’s possible to run Ruby for Windows on Windows in
a virtual machine (e.g. VirtualBox) on top of Linux. In both
cases (depending on which virtual machine you’re using), you
can access your native file system with your Ruby scripts.

RubyScript2Exe works in both cases.

I used to use the Wine option, but nowadays, I use the
VirtualBox option.

gegroet,
Erik V. - http://www.erikveen.dds.nl/

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs