Ruby version question

Yuri yuri at rawbw.com
Sat Jan 6 21:41:39 UTC 2018


In order to get a Ruby version, I run this command:

 > $ ruby -r rbconfig -e 'C = RbConfig::CONFIG' -e 'puts C["ruby_version"]'

 > 2.4


However, on Ubuntu 17.10 the same command returns 2.3.0 (with the minor 
version of zero).


My question is which one is correct, or "more correct"? Should it rather 
be 2.4.0? Or both are correct?


I recommended one upstream maintainer to get the current ruby version 
using this command, and then to use 'pkg-config ruby-${THIS_VERSION} 
--libs', but he says that Ubuntu prints it in a different format.


2.4 matches .pc file on FreeBSD, and doesn't on Ubuntu.

Is this a bug on Ubuntu? On FreeBSD?


Yuri



More information about the freebsd-ports mailing list