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?
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.
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.
Have you checked whether Rubinius or JRuby would allow you to precompile your code?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With