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

D

dare ruby

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
 
J

Jonathan Nielsen

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 Nielsen
 
D

Daniel Berger

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
 
B

Brian Candler

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(c)] }.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 (C) 1993-2009 Yukihiro Matsumoto"]
["RUBY_PATCHLEVEL", 174]
["PLATFORM", "x86_64-linux"]
["RUBY_RELEASE_DATE", "2009-06-12"]
 
H

Heesob Park

2010/3/19 Daniel Berger said:
-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 Heesob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top