32- or 64-bit Ruby?

For the most part Ruby abstracts the architecture of the machine, but sometimes you need to know quickly and easily when you are installing components.  So… how do you tell in Ruby if you are on a 64-bit architecture? I like this concise answer best:

>>  (-1).size

If this evaluates to 8 you are on a 64-bit architecture.  If it is 4, it is 32-bit.

Post a Comment

Your email is never shared. Required fields are marked *