开发者

How can I get the jruby version at runtime?

开发者 https://www.devze.com 2023-01-06 18:12 出处:网络
I need to get the jruby version for logging & debugging purposes. I tried looking around JRuby.runtime for a version method, but I didn\'t find anything useful.

I need to get the jruby version for logging & debugging purposes.

I tried looking around JRuby.runtime for a version method, but I didn't find anything useful.

I also thought about using %x{jruby -v}. It works in most cases, except that there is always the possibility that more than one j开发者_如何转开发ruby version are installed, and I want to get the version of the currently running interpreter.

Did I miss something? Any suggestion?


You are looking for the global constant JRUBY_VERSION. This is a brother of VERSION, RUBY_ENGINE (not available under 1.8.x), RUBY_PLATFORM, etc.

0

精彩评论

暂无评论...
验证码 换一张
取 消