From: "Iñaki Baz Castillo" Date: 2010-01-16T01:59:55+09:00 Subject: Re: How to know the OS architecture (32 or 64 bits)? El Viernes, 15 de Enero de 2010, Iñaki Baz Castillo escribió: > Note that to know the bits it uses "rbconfig" gem, and them: Well, "rbconfig" is not a gem but a Ruby built in library. > In my server RbConfig::CONFIG['host_os'] = "linux-gnu" so finally it ends > doing: > > if (1<<32).class == Fixnum > 64 > else > 32 > end > > Which is basically the same as doing > > if 1.size == 8 > 64 > else > 32 > end > Definitively I don't like "os" gem at all. It could use RbConfig::CONFIG['host_cpu'] rather than the not reliable RbConfig::CONFIG['host_os']: a) 32 bits host: RbConfig::CONFIG['host_os'] => "linux-gnu" RbConfig::CONFIG['host_cpu'] => "i486" b) 64 bits host: RbConfig::CONFIG['host_os'] => "linux-gnu" RbConfig::CONFIG['host_cpu'] => "x86_64" -- Iñaki Baz Castillo