Is there any way to fin 32 bit or 64 bit version?

Dear friends,

Is there any way to find whether the installed ruby is of 32 bit version
or 64 bit version.

Actually i have installed slackware 13 in 32 bit machine. What would be
default ruby version in slackware 13 whether the ruby is for 32 bit
machine or 64 bit machine?

Ruby -v shows : ruby 1.8.7 (2009-06-12 patchlevel 174) [i486-linux]

Please suggest me the default ruby that comes with slackware 13? whether
its for 32 bit machine or 64 bit machine?

Thanks in advance

Regards,
Jose MArtin

Actually i have installed slackware 13 in 32 bit machine. What would be
default ruby version in slackware 13 whether the ruby is for 32 bit
machine or 64 bit machine?

Ruby -v shows : ruby 1.8.7 (2009-06-12 patchlevel 174) [i486-linux]

[i486-linux] indicates this is a 32-bit version. A 64-bit version
would say something like [amd64-linux] I believe.

-Jonathan N.

On Mar 18, 11:02 pm, dare ruby [email protected] wrote:

Dear friends,

Is there any way to find whether the installed ruby is of 32 bit version
or 64 bit version.

-1.size > 4 ? “64Bit” : “32Bit”

Regards,

Dan

On a 64-bit machine (Ubuntu Karmic):

$ ruby -v
ruby 1.8.7 (2009-06-12 patchlevel 174) [x86_64-linux]

Object.constants.map { |c| [c,Object.const_get©] }.each { |c,v| p [c,v] if c=~/RUBY/ || v =~ /86/}; nil
[“RUBY_DESCRIPTION”, “ruby 1.8.7 (2009-06-12 patchlevel 174)
[x86_64-linux]”]
[“RUBY_PLATFORM”, “x86_64-linux”]
[“RUBY_VERSION”, “1.8.7”]
[“RUBY_COPYRIGHT”, “ruby - Copyright © 1993-2009 Yukihiro M.”]
[“RUBY_PATCHLEVEL”, 174]
[“PLATFORM”, “x86_64-linux”]
[“RUBY_RELEASE_DATE”, “2009-06-12”]

2010/3/19 Daniel B. [email protected]:

On Mar 18, 11:02Â pm, dare ruby [email protected] wrote:

Dear friends,

Is there any way to find whether the installed ruby is of 32 bit version
or 64 bit version.

-1.size > 4 ? “64Bit” : “32Bit”

That’s not true for MS Windows.

c:\work\ruby-1.9.1-p376>ruby -ve ‘p(-1.size)’
ruby 1.9.1p376 (2009-12-07 revision 26041) [x64-mswin64_90]
4

Try:
[‘a’].pack(‘P’).length > 4 ? “64Bit” : “32Bit”

Regards,

Park H.