I know it’s possible to get the Ruby version (e.g. “1.9.3”) via the RUBY_VERSION constant. However, I want to know how to go about determining the exact version (e.g.: “1.9.3-p0”). The reason is that there is a bug that was not fixed in earlier versions of Ruby 1.9.3 that is working in later versions, and I want some code in a gem I’m working on to account for this.
I know it’s possible to get the Ruby version (e.g. 1.9.3) via the RUBY_VERSION
Share
There is a
RUBY_PATCHLEVELconstant as well. So you can get your version string as