I need to package Ruby application (a batch job), and distribute to other users. Ideally I don’t need user to setup Ruby, and the package shall contain all the dependencies in it.
Is there easy way to do this? I am using Ruby v1.9.3.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Your not clear in your question, so I’ll assume the following are true:
Given that, your best bet is probably the ‘ocra’ gem. With it you can package your script into an .exe using
ocra <script>.rb. That will bundle your Ruby runtime, any gems your script uses, and your source into a<script>.exefile, like so:Since it packages your existing ruby runtime, you should probably be running a 32-bit Ruby to ensure that your executable can run on both 32 and 64-bit platforms.
If you need something more than ocra can provide, your best bet is going to be to build an installer that packages Ruby and your application.