How to obtain Ruby version info from a program code


#1

Hello,

Is there an API call returning Ruby version on which the code is
running? Eg. the same information which is returned by running “ruby
–version” on command line? I cannot find one.

Thanks,
Karel


#2

The constant RUBY_VERSION.

regards,
Jan F.


#3

Guest wrote:

The constant RUBY_VERSION.

regards,
Jan F.

Great! Thanks for your fast response :slight_smile: