Quantcast
Channel: What's the best-practice way to find out the platform ruby is running on? - Stack Overflow
Browsing latest articles
Browse All 3 View Live

Answer by Darshan Rivka Whittle for What's the best-practice way to find out...

There's always:begin require 'win32console'rescue LoadErrorendI find this easier to write and reason about that trying to decide for myself which OS I'm on and whether or not to load it.Update: I was...

View Article


Answer by peter for What's the best-practice way to find out the platform...

Nothing wrong with using RUBY_PLATFORM, it is its purpose.You could also ask it the OS itself, for windows that would beENV['OS']Which gives "Windows_NT" on a Vista.Don't know the counterpart for the...

View Article


What's the best-practice way to find out the platform ruby is running on?

I am using colored gem for coloured printing in the terminal and ruby logger. I need to run this code on linux and on windows. On windows, I must first require 'win32console' or else coloured printing...

View Article
Browsing latest articles
Browse All 3 View Live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>