Computer Science Canada Ruby Script to .exe |
Author: | [Gandalf] [ Fri Aug 26, 2005 2:54 am ] | ||||
Post subject: | Ruby Script to .exe | ||||
Well, I finally got around to trying this out, and it works like a charm . All you need is a single ruby file, and you just add it before your own ruby program to compile:
You have the option of adding some parameters if you like, but they are not neccessary as default is fine. Anways, I was just going to ask someone to test out the .exe (someone who doesn't have Ruby installed) to see if it works. The final executable is smaller than a Turing executable, at least under windows - the following code "compiled" to 665kb as opposed to Turing's 709kb. I could probably minimize the by using some parameters though (not sure).
Attached is the exe .rar'ed. |
Author: | wtd [ Fri Aug 26, 2005 2:59 am ] |
Post subject: | |
Note: when you run "ruby rubyscript2exe.rb HelloWorld.rb", you're not passing "HelloWorld.rb" to ruby itself. You're passing it to the application created by running "ruby rubyscript2exe.rb". |
Author: | Hikaru79 [ Fri Aug 26, 2005 8:15 am ] |
Post subject: | |
Works great for me Now, what I'm curious about is, if you use some third-party libraries that you install, will it be smart enough to package those too by default, or do you have to manually specify those to the program? |
Author: | wtd [ Fri Aug 26, 2005 3:50 pm ] | ||||
Post subject: | |||||
I would further suggest installing this via the gem. Just:
Then you should just be able to call:
|
Author: | wtd [ Fri Aug 26, 2005 3:54 pm ] | ||
Post subject: | |||
Hikaru79 wrote: Works great for me Now, what I'm curious about is, if you use some third-party libraries that you install, will it be smart enough to package those too by default, or do you have to manually specify those to the program?
|
Author: | [Gandalf] [ Fri Aug 26, 2005 7:34 pm ] |
Post subject: | |
Well then looks good . Now I have to try some other things with it, like with that tar2rubyscript and some other things. I noticed that although the executable is smaller than Turing's, the reason is that it is already heavily compressed, while Turing's is not. Therefore, if you try to compress the Ruby .exe, it will not seem as effective as with a Turing .exe. |
Author: | wtd [ Fri Aug 26, 2005 7:51 pm ] |
Post subject: | |
In an era of widespread broadband and large hard drives... does it really matter? |
Author: | [Gandalf] [ Fri Aug 26, 2005 8:08 pm ] |
Post subject: | |
Well... It's always nice to have something smaller. If I compiled my whole programming directory on this comp that would be a gigabyte instead of a managable 25mb of source. If I had each of those compressed though, that would be 4 times less to carry around, and 4 times faster to store, download, move, scan, or whatever you are doing. There are also cases like when you have a cheap website, say 20mb, where having a 100kb file is better than a 1mb one. |
Author: | wtd [ Fri Aug 26, 2005 8:11 pm ] |
Post subject: | |
Then just store the Ruby script there and simply ask people to install Ruby. |
Author: | Tony [ Fri Aug 26, 2005 8:33 pm ] |
Post subject: | |
[Gandalf] wrote: Well... It's always nice to have something smaller.
Unless we're not talking about space your program takes up Seriously though, just keep Ruby as is and let users install the interpreter. Not everybody can run .exe's anyways. |
Author: | wtd [ Fri Aug 26, 2005 8:41 pm ] |
Post subject: | |
Tony wrote: [Gandalf] wrote: Well... It's always nice to have something smaller.
Unless we're not talking about space your program takes up Seriously though, just keep Ruby as is and let users install the interpreter. Not everybody can run .exe's anyways. Indeed. You'd have to store versions for Windows, Linux, and Mac OS X, as well as probably having versions on hand for numerous other *nixes. |
Author: | [Gandalf] [ Sat Aug 27, 2005 3:41 am ] |
Post subject: | |
Well... Ya... It was in my comparison to Turing though, and the same applies to it. I'm not going to be making commercial programs with it (obviously), but I just like to have the reassurance that I can use my program on another computer without installing Ruby. Anyways, tomorrow I will try to learn a bit more Ruby to try and put all this to use . |
Author: | wtd [ Sat Aug 27, 2005 3:52 am ] |
Post subject: | |
[Gandalf] wrote: I'm not going to be making commercial programs with it (obviously)
Why not? Ruby's certainly capable. |
Author: | [Gandalf] [ Sat Aug 27, 2005 3:57 am ] |
Post subject: | |
It's myself that's not capable . No, but my point was that I will not be distributing my programs to many people in the near future, so it doesn't matter as much. |
Author: | wtd [ Sat Aug 27, 2005 4:15 am ] |
Post subject: | |
[Gandalf] wrote: It's myself that's not capable .
That'll change. |
Author: | yuyumo [ Sun Aug 21, 2011 11:12 am ] | ||||||||
Post subject: | Re: Ruby Script to .exe | ||||||||
Hi, I've Netbeans 6.9.1 and I installed the rubyscript2exe.rb in the Shell with:
It was successful. Now, I'm trying to convert my main.rb with it, but it doesn't work! First I put this line on the top of the code of my main.rb:
Secondly I tried to convert it to exe in the shell with this command:
Here I'm getting the following:
Thanx for your help! |
Author: | Velocity [ Mon Nov 28, 2011 11:12 am ] |
Post subject: | RE:Ruby Script to .exe |
YOU HAVE TO IDENTIFY THE RB SHELL IN YOUR LIBRARY/RUBY DIRECTORY sorry for caps it was just an obvious mistake or ask tony. |