# Checking the name of the host Operating System

**URL:** <https://www.ruby-forum.com/t/checking-the-name-of-the-host-operating-system/85461>\
**Category:** Ruby\
**Created:** [February 13, 2007, 9:07pm UTC](https://www.ruby-forum.com/t/checking-the-name-of-the-host-operating-system/85461 "2007-02-13T21:07:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![soroe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f9ae1b/32.png) [@soroe](https://www.ruby-forum.com/u/soroe)\
**Post date:** [February 13, 2007, 9:07pm UTC](https://www.ruby-forum.com/t/checking-the-name-of-the-host-operating-system/85461/1 "2007-02-13T21:07:52Z")

</div>

Hey Guys,

Anyone know how I can determine the name of the host operating system  
from within Ruby?

Sonny.

---

<div class="post-metadata">

**Author:** ![soroe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f9ae1b/32.png) [@soroe](https://www.ruby-forum.com/u/soroe)\
**Post date:** [February 13, 2007, 9:25pm UTC](https://www.ruby-forum.com/t/checking-the-name-of-the-host-operating-system/85461/2 "2007-02-13T21:25:49Z")

</div>

On Feb 13, 2007, at 2:07 PM, Sonny C. wrote:

> Hey Guys,
> 
> Anyone know how I can determine the name of the host operating system  
> from within Ruby?

Sure:

> > RUBY\_PLATFORM  
> > =\> “i686-darwin8.8.1”
> 
> > require “rbconfig”  
> > =\> false
> 
> > Config::CONFIG[“target”]  
> > =\> “i686-apple-darwin8.8.1”
> 
> > Config::CONFIG[“arch”]  
> > =\> “i686-darwin8.8.1”
> 
> > Config::CONFIG[“target\_os”]  
> > =\> “darwin8.8.1”

Hope that helps.

James Edward G. II

---

<div class="post-metadata">

**Author:** ![soroe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f9ae1b/32.png) [@soroe](https://www.ruby-forum.com/u/soroe)\
**Post date:** [February 13, 2007, 9:29pm UTC](https://www.ruby-forum.com/t/checking-the-name-of-the-host-operating-system/85461/3 "2007-02-13T21:29:39Z")

</div>

Thanks James, that’s exactly what I need.

Sonny.

James G. wrote:

> On Feb 13, 2007, at 2:07 PM, Sonny C. wrote:
> 
> > Hey Guys,
> > 
> > Anyone know how I can determine the name of the host operating system  
> > from within Ruby?
> 
> Sure:
> 
> > > RUBY\_PLATFORM  
> > > =\> “i686-darwin8.8.1”
> > 
> > > require “rbconfig”  
> > > =\> false
> > 
> > > Config::CONFIG[“target”]  
> > > =\> “i686-apple-darwin8.8.1”
> > 
> > > Config::CONFIG[“arch”]  
> > > =\> “i686-darwin8.8.1”
> > 
> > > Config::CONFIG[“target\_os”]  
> > > =\> “darwin8.8.1”
> 
> Hope that helps.
> 
> James Edward G. II
