Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can ruby scripts be precompiled into a binary?

I'm working on a Ruby script that will need to be deployed onto systems without a ruby interpreter. It will need to run on FreeBSD systems which uses the ELF format.

I know there is a ruby2exe project to compile ruby scripts to run on Windows, but is it easy or even possible to do that on other operating systems?

like image 228
chrisbdaemon Avatar asked Apr 13 '11 19:04

chrisbdaemon


People also ask

How do I create a Ruby script?

Creating a Ruby Script. Let's start by creating a "Hello World!" script in Ruby. #!/usr/bin/env ruby puts "Hello world!" We can run this script in the command line by going to the directory where the file lives and typing in ruby hello.

How do I run a Ruby script from the command line in Windows?

Open a command line window and navigate to your Ruby scripts directory using the cd command. Once there, you can list files, using the dir command on Windows or the ls command on Linux or OS X. Your Ruby files will all have the . rb file extension.


1 Answers

Have you checked whether Rubinius or JRuby would allow you to precompile your code?

like image 111
Andrew Grimm Avatar answered Sep 21 '22 00:09

Andrew Grimm