I’m looking for a solution to be able to deploy a Ruby script of mine on
a foreign server without giving out all of my original source code.
Instead I’d be happy to be able to generate bytecode from my source and
install that one.
I read about the bytecode export / import support in Ruby 2.0 here:
But I couldn’t figure out how to generate bytecode from my source, and
some search brought up the following issue:
Does anyone have any information when the 2.0 branch will contain full
bytecode support? Or what I can expect on short term?
Also, I can generate bytecode with JRuby, but since I’m using native
libs in my code (ruby-mysql), it doesn’t help currently. The code is
also tested so I wouldn’t go into any modification. So other solution is
welcome too.
“This uses jrubyc to precompile all .rb files in your application to
.class files…”
which in my case is not good, cause I use native libs too and as I
wrote, I already tested and JRuby cannot do that for me. So AFAIK JRuby
(jrubyc) is good only for codes without 3rd party extensions - or only
if someone writes the code originally for JRuby and its libs (jdbc
etc.).
Anyway, I will rather enable too the load function with
rb_define_singleton_method in iseq.c and recompile the interpreter.
Seems an easier way to go for me now.