School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 307,144 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,732 people online right now. Registration is fast and FREE... Join Now!




How to distribute Ruby Applications

 
Reply to this topicStart new topic

> How to distribute Ruby Applications, shows you how to create a .exe

Rickster0
Group Icon



post 7 Oct, 2009 - 03:27 AM
Post #1


Requirements:
Since ruby is an interpreted language, whenever you want to release your program you need to release the source code. Also your program users must install Ruby virtual machine before they can run your program. Is there a way to distribute ruby program as a standalone executable?

Erik Veenstra has created a tool called RubyScript2Exe which can convert a ruby program to an executable program. It does this by combining ruby interpreter code and your source code files into a single executable file.
First download the RubyScript2Exe. It is a ruby program ( abut 950kb in size). Create a simple ruby program called helloworld.rb and save it to the same location where you have RubyScript2Exe.rb stored.

CODE
puts "Hello World"  


From the command prompt, type the following,

CODE
ruby rubyscript2exe helloworld.rb


You will see the following output on console. Now you have a standalone executable program (helloworld.exe) which can be executed in any Windows machine! Combined with Win32API, you can create cool command line apps for Windows.

IPB Image

The only problem with this executable is that it contains the entire ruby VM and hence is large (helloworld.exe size is around 1.5MB). Also note that this is not really a ruby compiler. It doesn’t convert your ruby code to machine code. It only packages ruby virtual machine along with your ruby code. Hence the code is still interpreted.
RubyScript2Exe can also create executable files for Linux and Mac OS X.

If you need any other help, or you encounter any problems please PM me, or Post your problem here biggrin.gif
Go to the top of the page
+Quote Post


Register to Make This Ad Go Away!


Fast ReplyReply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 


Lo-Fi Version Time is now: 11/21/09 03:37PM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month