[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Create an exe with Ruby 1.9.1

Marc-antoine Kruzik

5/19/2009 7:36:00 PM

Hello !
I'm working on Windows and I'm creating softwares.

I would create an exe file for a program written in Ruby 1.9.1.
But Rubyscript2exe and Exerb are using Ruby 1.8.7 (or 1.8.6).

How can I create an exe file working on Windows for anybody ?
Why are they so few informations and librairies to create exe files ?

90% of computers in the world are Windows.
Making cool softwares in Ruby will be useless if they can't work on 90%
of computers...
--
Posted via http://www.ruby-....

22 Answers

imphasing

5/19/2009 7:43:00 PM

0

[Note: parts of this message were removed to make it a legal post.]

As far as I know, there's currently no way to generate an exe out of a ruby
1.9 script, short of packing the ruby script into the exe and calling the
external ruby interpreter. Since the ruby interpreter runs on windows just
fine though, why are you in need of an exe?
In the future it may be possible to compile the ruby bytecode into an exe
and bundle an interpreter with it, but I'm pretty sure nothing like that
exists yet.


Alex

On Tue, May 19, 2009 at 3:36 PM, Marc-antoine Kruzik
<kadelfek@kadelfek.com>wrote:

> Hello !
> I'm working on Windows and I'm creating softwares.
>
> I would create an exe file for a program written in Ruby 1.9.1.
> But Rubyscript2exe and Exerb are using Ruby 1.8.7 (or 1.8.6).
>
> How can I create an exe file working on Windows for anybody ?
> Why are they so few informations and librairies to create exe files ?
>
> 90% of computers in the world are Windows.
> Making cool softwares in Ruby will be useless if they can't work on 90%
> of computers...
> --
> Posted via http://www.ruby-....
>
>

Tim Hunter

5/19/2009 9:39:00 PM

0

Marc-antoine Kruzik wrote:
> Hello !
> I'm working on Windows and I'm creating softwares.
>
> I would create an exe file for a program written in Ruby 1.9.1.
> But Rubyscript2exe and Exerb are using Ruby 1.8.7 (or 1.8.6).
>
> How can I create an exe file working on Windows for anybody ?
> Why are they so few informations and librairies to create exe files ?
>
> 90% of computers in the world are Windows.
> Making cool softwares in Ruby will be useless if they can't work on 90%
> of computers...

You assume that the only way to run a Ruby program on Windows is to
bundle it up with a 1.9.1 interpreter into an executable. Clearly that's
not true. You can bundle a Ruby program with a 1.8.6/1.8.7 interpreter,
or you can just install Ruby 1.9.1 and run all the Ruby programs you can
lay your hands on. You also assume that cool software only runs on
Windows. I can assure you that's not true.

I'd like to point out that Rubyscript2exe and Exerb are the work of
volunteers. It may be true that 90% of the computers in the world are
Windows, but if so, why aren't 90% of the volunteers contributing to
Ruby from the Windows world? As near as I can tell there's just a
handful - less than a hundred? less than 20? - of people with experience
in Windows who are actively contributing to Ruby.

--
RMagick: http://rmagick.ruby...

Marc-antoine Kruzik

5/20/2009 12:21:00 PM

0

Tim Hunter wrote:
> Marc-antoine Kruzik wrote:
>> Making cool softwares in Ruby will be useless if they can't work on 90%
>> of computers...
>
> You assume that the only way to run a Ruby program on Windows is to
> bundle it up with a 1.9.1 interpreter into an executable. Clearly that's
> not true. You can bundle a Ruby program with a 1.8.6/1.8.7 interpreter

Yes, I still have released programs written for Ruby 1.8.6.
But can I really run a program made with Ruby 1.9.1 ?


> You also assume that cool software only runs on
> Windows. I can assure you that's not true.

I didn't say that. I'm saying that cool softwares made with Ruby will
have some difficulties to be released on all the platforms (I mean,
Windows / Linux / Mac).
I have been working for years with Ruby. Now I'm creating softwares, but
I'm stuck with Ruby 1.8.6.

If I use one method which only exists with Ruby 1.9.1 (ascii_only? by
example), my exe program will not work (because Exerb and Rubyscript2exe
are using 1.8.6).

And it's very sad, because 1.9.1 is faster than 1.8.6, and because the
slowness of Ruby is one of its biggest problem (but I love Ruby !).


> I'd like to point out that Rubyscript2exe and Exerb are the work of
> volunteers. [...] less than a hundred? less than 20? -
> of people with experience
> in Windows who are actively contributing to Ruby.

Yes, I knew it. But I didn't know there were so few people with
experience in Windows contributing to Ruby.
And I think it's bad, because Ruby really deserves to be working on all
platforms.
--
Posted via http://www.ruby-....

Marc-antoine Kruzik

5/20/2009 12:36:00 PM

0

(I forgot a CTRL+V)

Alex wrote:
> fine though, why are you in need of an exe?

Because I gave my softwares to people who doesn't have Ruby. And they
are using Windows.
So, the exe is the fastest way to release my softwares.

My main project is a software which can extract dialogs from a RPG Maker
game, and put these dialogs in a txt file.
It's used by 20 to 50 game projects in at least 5 languages.

But I really need to use Ruby 1.9.1, because of the new String features.
I have had a lot of problems with UTF-8 and Ascii ("é" which could be
written with 1 or 2 bits).
In order to make my software compatible with other languages (such as
Japanese), I really need these features.

And fastest execution. Because it takes 20 minutes to extract dialogs
for a big project.
--
Posted via http://www.ruby-....

Lars Christensen

5/20/2009 12:36:00 PM

0

On Tue, May 19, 2009 at 9:36 PM, Marc-antoine Kruzik
<kadelfek@kadelfek.com> wrote:
> I would create an exe file for a program written in Ruby 1.9.1.
> But Rubyscript2exe and Exerb are using Ruby 1.8.7 (or 1.8.6).

OCRA works with Ruby 1.9. http://ocra.ruby...

Marc-antoine Kruzik

5/20/2009 3:14:00 PM

0

Lars Christensen wrote:
> On Tue, May 19, 2009 at 9:36 PM, Marc-antoine Kruzik
> <kadelfek@kadelfek.com> wrote:
>> I would create an exe file for a program written in Ruby 1.9.1.
>> But Rubyscript2exe and Exerb are using Ruby 1.8.7 (or 1.8.6).
>
> OCRA works with Ruby 1.9. http://ocra.ruby...

Do you know where I can have more informations about Ocra ?
I downloaded ocrasa, I put it in c:/ruby/bin (a 1.9.0 version) and I
tried to compile a script containing this line :

puts "Hello World"

The compilation seems to be ok (I just modified the path of my ruby dir
in rbconfig.rb "C:\LAN\..." => "C:\ruby").
During compilation, I have had a warning because enumerable.so was not
found.

When I launch the exe file, I have an error message :
"failed to create directory"

I run on Vista, so I tried to launch the exe on XP (because the failed
creation maybe occurs because of Vista). But I have the same problem.


I looked at the code in ocrasa.rb, and I saw that the scrip use
ENV["TEMP"] without any problem.
So, why the exe have a problem when it tries to create a folder ?

Because I suppose this bug occurs when ocra tries to extract the
contents of the exe into a temporary directory.
--
Posted via http://www.ruby-....

Charles Calvert

5/21/2009 9:43:00 PM

0

On Tue, 19 May 2009 14:43:10 -0500, Alex <imphasing@gmail.com> wrote
in <40a4cac50905191242h13c10f7as48c07db0e6609605@mail.gmail.com>:

>As far as I know, there's currently no way to generate an exe out of a ruby
>1.9 script, short of packing the ruby script into the exe and calling the
>external ruby interpreter. Since the ruby interpreter runs on windows just
>fine though, why are you in need of an exe?

In the Windows world, it is not normal to expect end users to install
an interpreter in order to run software. Because Windows software is
almost exclusively distributed in executable binary form, that's what
users expect.

Depending on one's target market for an application, asking them to
alter this expectation may well result in people refusing to use the
software. Between a general lack of computer literacy and the fear of
malware, it's a hard barrier to break.

>In the future it may be possible to compile the ruby bytecode into an exe
>and bundle an interpreter with it, but I'm pretty sure nothing like that
>exists yet.

An alternative might be IronRuby, if the OP is willing to live with
the dependency on .NET.
--
Charles Calvert | Web-site Design/Development
Celtic Wolf, Inc. | Software Design/Development
http://www.celti... | Data Conversion
(703) 580-0210 | Project Management

Luis Lavena

5/21/2009 10:25:00 PM

0

On May 20, 12:13 pm, Marc-antoine Kruzik <kadel...@kadelfek.com>
wrote:
> Lars Christensen wrote:
> > On Tue, May 19, 2009 at 9:36 PM, Marc-antoine Kruzik
> > <kadel...@kadelfek.com> wrote:
> >> I would create an exe file for a program written in Ruby 1.9.1.
> >> But Rubyscript2exe and Exerb are using Ruby 1.8.7 (or 1.8.6).
>
> > OCRA works with Ruby 1.9.http://ocra.ruby...
>
> Do you know where I can have more informations about Ocra ?
> I downloaded ocrasa, I put it in c:/ruby/bin (a 1.9.0 version) and I
> tried to compile a script containing this line :
>
> puts "Hello World"
>
> The compilation seems to be ok (I just modified the path of my ruby dir
> in rbconfig.rb "C:\LAN\..." => "C:\ruby").
> During compilation, I have had a warning because enumerable.so was not
> found.
>
> When I launch the exe file, I have an error message :
> "failed to create directory"
>
> I run on Vista, so I tried to launch the exe on XP (because the failed
> creation maybe occurs because of Vista). But I have the same problem.
>
> I looked at the code in ocrasa.rb, and I saw that the scrip use
> ENV["TEMP"] without any problem.
> So, why the exe have a problem when it tries to create a folder ?
>
> Because I suppose this bug occurs when ocra tries to extract the
> contents of the exe into a temporary directory.

I've used both 1.8 and 1.9 with ocra gem without any kind of issue.

Also, running as normal user.

Maybe you're trying to create a folder form your script?

Please try the gem version instead of the standalone one.
--
Luis Lavena

James Britt

5/22/2009 6:46:00 AM

0

Charles Calvert wrote:
> On Tue, 19 May 2009 14:43:10 -0500, Alex <imphasing@gmail.com> wrote
> in <40a4cac50905191242h13c10f7as48c07db0e6609605@mail.gmail.com>:
>
>> As far as I know, there's currently no way to generate an exe out of a ruby
>> 1.9 script, short of packing the ruby script into the exe and calling the
>> external ruby interpreter. Since the ruby interpreter runs on windows just
>> fine though, why are you in need of an exe?
>
> In the Windows world, it is not normal to expect end users to install
> an interpreter in order to run software. Because Windows software is
> almost exclusively distributed in executable binary form, that's what
> users expect.
>

Except with Java. If the use does not have the proper version of the
JVM, they will get prompted (or can be, I don't know how automatic this
is) to download a newer version.

I've no surveys on this, only my own experience, but I don't think
Windows users are too spooked about having to get a more current JVM.


> Depending on one's target market for an application, asking them to
> alter this expectation may well result in people refusing to use the
> software. Between a general lack of computer literacy and the fear of
> malware, it's a hard barrier to break.
>
>> In the future it may be possible to compile the ruby bytecode into an exe
>> and bundle an interpreter with it, but I'm pretty sure nothing like that
>> exists yet.
>

JotBot, my cross-platform desktop app for time tracking, is written in
JRuby, and expects Java 1.6, and a user will get prompted to download
that if it is not available when installing JotBot.

I've not gotten any complaints, though that's not to say some just gave
up and never bothered to tell me.


This may be all academic to the OP as JRuby does not fully implement
Ruby 1.9 yet.

But distributing JRuby apps as Windows exe files is certainly doable.

--
James Britt

www.jamesbritt.com - Playing with Better Toys
www.ruby-doc.org - Ruby Help & Documentation
www.rubystuff.com - The Ruby Store for Ruby Stuff
www.neurogami.com - Smart application development

Marc-antoine Kruzik

5/22/2009 9:58:00 AM

0

Luis Lavena wrote:
>
> I've used both 1.8 and 1.9 with ocra gem without any kind of issue.
>
> Also, running as normal user.
>
> Maybe you're trying to create a folder form your script?
>
> Please try the gem version instead of the standalone one.

I can't install ocra gem with Ruby 1.9.
I have this problem :
http://i291.photobucket.com/albums/ll318/KingKadelfek/r...

But I cheated a lot (I copied ocra gem from my Ruby 1.8.6 folder into my
Ruby 1.9.0 folder), so it works.

Now, my "puts 'Hello World !'" is working, so I will try to compile my
software.

--

I installed "ruby-1.9.0-0-i386-mswin32", but a lot of files were missing
:
- readlines.dll
- zlib.dll
- libeay32.dll
- ssleay32.dll

So I took these files from my Ruby 1.8.6 folder.

Is it okay ?
--
Posted via http://www.ruby-....