我正在尝试更新我在 Scientific Linux 上运行的 ruby 版本,但是命令:
$ rvm install ruby-2.1.6
失败并出现此错误:
checking size of long long... configure: error: in `/localdisk/home/user/.rvm/src/ruby-2.1.6':
configure: error: cannot compute sizeof (long long)
如果我尝试重新安装之前安装的 ruby 版本,我也会遇到同样的错误。我不知道发生了什么变化,但我确实有另一台机器,其设置非常相似并且可以正常工作。我比较了工作和失败安装中的 configure.log 文件。以下是不同之处:
$ 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
两台机器的发布信息完全相同:
-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)
我在谷歌上搜索了一下,感觉这可能与我的 gcc 设置有关。请给我有关如何调试和修复此问题的建议。 谢谢。
最佳答案
我在构建 ruby 2.7.2 时遇到了同样的问题(configure: error: cannot compute sizeof (long long)
)。在 debian 上。通过安装 binutils 修复:
apt-get install -y binutils
关于ruby - '配置 : error: cannot compute sizeof (long long)' on scientific linux when installing ruby,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32396871/