K
Kless
Is there any method that returns the operating sytem being used?
Victor said:Check out the Ruby Constants... PLATFORM could be one.
Angels and ministers of grace defend us!
Kless said:I haven't that constant, but 'target_os'.
The constant is RUBY_PLATFORM.
If more info is needed, check the output of this,
require 'rbconfig'
require 'pp'
pp Config::CONFIG
Daniel said:The constant is RUBY_PLATFORM.
I recommend against this because of JRuby (and probably IronRuby).
JRuby, for example, will return "java" for RUBY_PLATFORM.
If more info is needed, check the output of this,
require 'rbconfig'
require 'pp'
pp Config::CONFIG
There you go. Take a look at Config['host_os'].
Yes, my Ubuntu shows:Is there an example of CONFIG["target_os"] != CONFIG["host_os"] ?
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.