6

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?

chrisbdaemon
  • 416
  • 4
  • 12
  • 3
    The accepted answer is pretty vague. Did you ever solve this, and if so how? – Robert Martin Dec 11 '12 at 23:23
  • Sadly I don't think I did. I think I eventually just gave up on it. For anyone coming later on if I were to do it again I would look at using libruby or something like that. – chrisbdaemon Nov 09 '15 at 19:12

2 Answers2

5

Aside from bytecode that requires a VM to run, Ruby cannot be compiled. It is an interpreted langauge and as such requires an interpreter. ruby2exe packages a ruby interpreter and runtime library with your application.

Rein Henrichs
  • 15,437
  • 1
  • 45
  • 55
5

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

Andrew Grimm
  • 78,473
  • 57
  • 200
  • 338