user2167582
user2167582

Reputation: 6368

Can I find out what implementation of ruby is being used?

as questions states is there a way to find out if my ruby implementation is mri, yarv, or jruby, etc.

I want to know how I can check if some errors were due to implementations.

Edited::

I want to check if mine is Rubinus, MRI, YARV, etc..

Upvotes: 0

Views: 322

Answers (1)

August
August

Reputation: 12558

Look at the RUBY_ENGINE constant:

On RMI:

RUBY_ENGINE # => "ruby"

On JRuby:

RUBY_ENGINE # => "jruby"

On Rubinius:

RUBY_ENGINE # => "rbx"

RUBY_DESCRIPTION gives you even more information:

(JRuby)

RUBY_DESCRIPTION
# => jruby 1.7.15 (1.9.3p392) 2014-09-03 82b5cc3 on Java HotSpot(TM) 64-Bit Server VM 1.8.0_11-b12 +jit [darwin-x86_64]

Upvotes: 5

Related Questions