0

RUBY_PLATFORM is java either way.

Normally I can do system checks with uname but Windows doesn't have uname command. (and checking that uname didn't run correctly is pretty silly)

taw
  • 18,110
  • 15
  • 57
  • 76
  • http://stackoverflow.com/questions/228477/how-do-i-programmatically-determine-operating-system-in-java (relates to JVMs in general, and thus JRuby) –  Mar 31 '12 at 19:24

2 Answers2

2
require 'rbconfig'

puts RbConfig::CONFIG['host_os']
Justin Workman
  • 688
  • 6
  • 12
1

In addition, if you need underlying architecture, you can check RUBY_DESCRIPTION, and look between [ and ].

irb(main):004:0> RUBY_DESCRIPTION
=> "jruby 1.7.0.dev (ruby-1.9.3-p139) (2012-03-30 387d8ad) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_29) [darwin-x86_64-java]"
banzaiman
  • 2,631
  • 18
  • 27