Misc #15474

Running Rails with jit

Added by foonlyboy (Eike Dierks) over 1 year ago. Updated over 1 year ago.



I have installed ruby-2.6.0
I want to try to run my rails app with the jit.

How can this be done?
I should try env RUBY_OPTS='--jit'
Is this the way the go?

The jit ist experimental, but promising,
so we need to try it wherever we can.

there needs to be a clear documentation,
how to enable or disable jit

I'd like to enable jit by default,
when running 2.6.0

running 2.5.3 with --jit gives:
/opt/local/bin/ruby --jit -e 'puts "hello world"'
/opt/local/bin/ruby: invalid option --jit (-h will show valid options) (RuntimeError)

I'd like to suggest a new env: RUBY_JIT
which should only be respected by ruby >= 2.6.0


Updated by shevegen (Robert A. Heiler) over 1 year ago

There is some documentation at:

I believe Takashi and others may update that page every now and then.

To the suggestion of a new environment variable:

I have no particular pro or con opinion; to me it seems fine but I think this
has to be decided by Takashi, matz, the ruby core team etc...

If I understood you correctly you refer to RUBY_JIT as an additional option,
right? So people may be able to use either RUBYOPT or RUBY_JIT too.

Again, I have no preference either way; I just want to make the proposal
itself more accurate when possible. (It may help the ruby core team decide
on the proposal; I assume it may go either way, where it may be decided that
RUBYOPT might suffice or it may be decided that RUBY_JIT is ok too. I myself
have really no preference.)

The example given on the wiki-page is this, by the way:


I think people may not easily find the page as of yet. I have bookmarked it
locally so that I can find the page easily and not forget it. :)

Updated by k0kubun (Takashi Kokubun) over 1 year ago

  • Status changed from Open to Rejected

RUBYOPT is answered by shevegen. Thanks. It was also explained in release notes. And you can use "ruby --jit bin/rails s" as well. Why do we want to have more ways to specify that?

which should only be respected by ruby >= 2.6.0

I'm not a fan of ignoring no-op config, rather I like asserting the config and making it fail. What if we typo the environment variable name? Even $RUBYOPT should be the last resort, as you typo-ed it to $RUBY_OPTS too.

Also available in: Atom PDF