From: dare ruby on
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
--
Posted via http://www.ruby-forum.com/.

From: Jonathan Nielsen on
> 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

From: Daniel Berger on


On Mar 18, 11:02 pm, dare ruby <mar...(a)angleritech.com> 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

From: Brian Candler on
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"]
--
Posted via http://www.ruby-forum.com/.

From: Heesob Park on
2010/3/19 Daniel Berger <djberg96(a)gmail.com>:
>
>
> On Mar 18, 11:02 pm, dare ruby <mar...(a)angleritech.com> 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 Heesob