I don't think it comes with Ruby on most platforms, but I *think* it's bundled with the MSF Installer, as well as in the framework gemfile: https://github.com/rapid7/metasploit-framework/blob/master/Gemfile#L10

If it's an issue using this gem, it can always be abstracted out to a lib in msf/*. I haven't yet looked but I imagine there's something there.