# Hardware detection

**URL:** <https://www.ruby-forum.com/t/hardware-detection/134770>\
**Category:** Ruby\
**Created:** [April 14, 2008, 11:12pm UTC](https://www.ruby-forum.com/t/hardware-detection/134770 "2008-04-14T23:12:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fox](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/c5a1d2/32.png) [@fox](https://www.ruby-forum.com/u/fox)\
**Post date:** [April 14, 2008, 11:12pm UTC](https://www.ruby-forum.com/t/hardware-detection/134770/1 "2008-04-14T23:12:54Z")

</div>

hi all,  
does the stock ruby (1.8) library have any classes that i can use to  
detect the current systems’ cpu type, and number of cpu’s etc?  
i’m hoping for something portable across linux, mac, bsd etc, but cant  
find much.

thanks.

---

<div class="post-metadata">

**Author:** ![fox](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/c5a1d2/32.png) [@fox](https://www.ruby-forum.com/u/fox)\
**Post date:** [April 14, 2008, 11:21pm UTC](https://www.ruby-forum.com/t/hardware-detection/134770/2 "2008-04-14T23:21:26Z")

</div>

On Apr 14, 3:12 pm, Paul F. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> hi all,  
> does the stock ruby (1.8) library have any classes that i can use to  
> detect the current systems’ cpu type, and number of cpu’s etc?  
> i’m hoping for something portable across linux, mac, bsd etc, but cant  
> find much.

Nothing stock, but there’s sys-cpu.

gem install sys-cpu

Regards,

Dan
