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

Discussion in 'Ruby' started by dare ruby, Mar 19, 2010.

  1. dare ruby

    dare ruby Guest

    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/.
     
    dare ruby, Mar 19, 2010
    #1
    1. Advertising

  2. > 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
     
    Jonathan Nielsen, Mar 19, 2010
    #2
    1. Advertising

  3. On Mar 18, 11:02=A0pm, dare ruby <> 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
     
    Daniel Berger, Mar 19, 2010
    #3
  4. 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/.
     
    Brian Candler, Mar 19, 2010
    #4
  5. dare ruby

    Heesob Park Guest

    2010/3/19 Daniel Berger <>:
    >
    >
    > On Mar 18, 11:02=C2=A0pm, dare ruby <> 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
     
    Heesob Park, Mar 20, 2010
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?bXVsdGlzeW5j?=
    Replies:
    0
    Views:
    2,176
    =?Utf-8?B?bXVsdGlzeW5j?=
    Dec 13, 2005
  2. Morgan Strickland
    Replies:
    0
    Views:
    445
    Morgan Strickland
    Dec 20, 2003
  3. mir nazim

    cannot fin sum() in python 2.3

    mir nazim, May 24, 2004, in forum: Python
    Replies:
    1
    Views:
    305
    Peter Maas
    May 24, 2004
  4. V Green
    Replies:
    0
    Views:
    863
    V Green
    Feb 5, 2008
  5. PA Bear [MS MVP]
    Replies:
    0
    Views:
    974
    PA Bear [MS MVP]
    Feb 5, 2008
Loading...

Share This Page