15

I'm trying to update my version of ruby, running on Scientific Linux, but the command:

$ rvm install ruby-2.1.6

fails with this error:

checking size of long long... configure: error: in `/localdisk/home/user/.rvm/src/ruby-2.1.6':
configure: error: cannot compute sizeof (long long)

I also get the same error if I try to reinstall the version of ruby that was installed previously. I don't know what's changed, but I do have another machine with a very similar set up that does work. I compared the configure.log file from the working and failed installations. Here are the differences:

$ diff configure_broken.log configure_working.log 
1c1
< [2015-09-03 14:59:13] ./configure
---
> [2015-09-03 14:41:20] ./configure
3,5c3
< GEM_HOME=/localdisk/home/user/.rvm/gems/ruby-2.1.3
< PATH=/localdisk/home/user/.rvm/gems/ruby-2.1.3/bin:/localdisk/home/user/.rvm/gems/ruby-2.1.3@global/bin:/localdisk/home/user/.rvm/rubies/ruby-2.1.3/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/localdisk/home/user/.rvm/bin
< GEM_PATH=/localdisk/home/user/.rvm/gems/ruby-2.1.3:/localdisk/home/user/.rvm/gems/ruby-2.1.3@global
---
> PATH=/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/localdisk/home/user/.rvm/bin
199,202c197,199
< checking gmp.h usability... yes
< checking gmp.h presence... yes
< checking for gmp.h... yes
< checking for __gmpz_init in -lgmp... yes
---
> checking gmp.h usability... no
> checking gmp.h presence... no
> checking for gmp.h... no
213,218c210,525
< checking size of int... 0
< checking size of short... 0
< checking size of long... 0
< checking size of long long... configure: error: in `/localdisk/home/user/.rvm/src/ruby-2.1.6':
< configure: error: cannot compute sizeof (long long)
< See `config.log' for more details
---
> checking size of int... 4
> checking size of short... 2
> checking size of long... 8
> checking size of long long... 8
> checking size of __int64... 0

Both machines have exactly the same release info:

-bash-4.1$ cat /etc/*release
LSB_VERSION=base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Scientific Linux release 6.5 (Carbon)
Scientific Linux release 6.5 (Carbon)

I have a feeling from the bit of googling I did that this might be something to do with my gcc set up. Please give me suggestions on how to debug and fix this. Thanks.

Eilidh Troup
  • 163
  • 1
  • 4

2 Answers2

0

I've had the same issue (configure: error: cannot compute sizeof (long long)), while building ruby 2.7.2. On debian. Fixed by installing binutils:

apt-get install -y binutils
SYN
  • 4,476
  • 1
  • 20
  • 22
-2

You can view the log output of the configure call in the config.log file in the build directory (e.g. /var/folders/fm/fn9fyfm10n7ch34843lcg1t80000gy/T/ruby-build.20180328150122.9202/ruby-2.3.1).

In my case the error was something like:

In file included from /usr/local/include/stdint.h:59:
/usr/local/include/stdint.h:2:10: error: #include nested too deeply
#include <stddef.h>
         ^
/usr/local/include/stdint.h:59:11: error: #include nested too deeply
# include <stdint.h>
          ^
/usr/local/include/stdint.h:72:11: error: #include nested too deeply
# include <sys/types.h>
          ^
/usr/local/include/stdint.h:76:10: error: #include nested too deeply
#include <limits.h>
         ^
/usr/local/include/stdint.h:82:11: error: #include nested too deeply
# include <inttypes.h>
          ^
5 errors generated.
configure:11616: $? = 1
configure: program exited with status 1
Steven Hepting
  • 12,394
  • 8
  • 40
  • 50