The OS gem allows for some easy telling if you're on windows or not. require 'os' >> OS.windows? => true >> OS.bits => 32 >> OS.java? => true >> OS.ruby_bin => "c:\ruby18\bin\ruby.exe" # or "/usr/local/bin/ruby" or what not >> OS.posix? => false >> OS.mac? => false If there are any other features you'd like, let me know. github.com/rdp/os Related: rubygems: Gem::Platform.local Gem.ruby facets gem (similar) require 'facets/platform' Platform.local the Platform gem