编译ruby1.9.1挂起并填充swap

发布于 2024-09-01 09:16:23 字数 4945 浏览 0 评论 0原文

我正在 Ubuntu 8.04 服务器 LTS(64 位)下编译 Ruby 1.9.1-p376,方法如下:

$ ./configure
$ make
$ sudo make install

./configure 工作正常,没有任何抱怨。

make 无限期地挂起,直到我所有的 RAM 和交换区都消失了。它在以下输出后卡住:

compiling ripper
make[1]: Entering directory `/tmp/ruby1.9.1/ruby-1.9.1-p376/ext/ripper'
gcc -I. -I../../.ext/include/x86_64-linux -I../.././include -I../.././ext/ripper -I../.. -I../../. -DRUBY_EXTCONF_H=\"extconf.h\"    -fPIC  -O2 -g -Wall -Wno-parentheses  -o ripper.o -c ripper.c

如果我手动运行 gcc 命令,并使用 -v 参数来获取详细输出,它会在以下输出后挂起:

Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.2 --program-suffix=-4.2 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.2.4 (Ubuntu 4.2.4-1ubuntu4)
 /usr/lib/gcc/x86_64-linux-gnu/4.2.4/cc1 -quiet -v -I. -I../../.ext/include/x86_64-linux -I../.././include -I../.././ext/ripper -I../.. -I../../. -DRUBY_EXTCONF_H="extconf.h" ripper.c -quiet -dumpbase ripper.c -mtune=generic -auxbase-strip ripper.o -g -O2 -Wall -Wno-parentheses -version -fPIC -fstack-protector -fstack-protector -o /tmp/ccRzHvYH.s
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/4.2.4/../../../../x86_64-linux-gnu/include"
ignoring nonexistent directory "/usr/include/x86_64-linux-gnu"
ignoring duplicate directory "../.././ext/ripper"
ignoring duplicate directory "../../."
#include "..." search starts here:
#include <...> search starts here:
 .
 ../../.ext/include/x86_64-linux
 ../.././include
 ../..
 /usr/local/include
 /usr/lib/gcc/x86_64-linux-gnu/4.2.4/include
 /usr/include
End of search list.
GNU C version 4.2.4 (Ubuntu 4.2.4-1ubuntu4) (x86_64-linux-gnu)
    compiled by GNU C version 4.2.4 (Ubuntu 4.2.4-1ubuntu4).
GGC heuristics: --param ggc-min-expand=47 --param ggc-min-heapsize=32795
Compiler executable checksum: 6e11fa7ca85fc28646173a91f2be2ea3

我刚刚编译在另一台计算机上安装 ruby​​ 以供参考,大约需要 10 秒才能打印以下输出(在上面的 Compilerexecutable checksum 行之后):

COLLECT_GCC_OPTIONS='-v' '-I.' '-I../../.ext/include/i686-linux' '-I../.././include' '-I../.././ext/ripper' '-I../..' '-I../../.' '-DRUBY_EXTCONF_H="extconf.h"' '-D_FILE_OFFSET_BITS=64' '-fPIC' '-O2' '-g' '-Wall' '-Wno-parentheses' '-o' 'ripper.o' '-c' '-mtune=generic' '-march=i486'
 as -V -Qy -o ripper.o /tmp/cca4fa7R.s
GNU assembler version 2.20 (i486-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.20
COMPILER_PATH=/usr/lib/gcc/i486-linux-gnu/4.4.1/:/usr/lib/gcc/i486-linux-gnu/4.4.1/:/usr/lib/gcc/i486-linux-gnu/:/usr/lib/gcc/i486-linux-gnu/4.4.1/:/usr/lib/gcc/i486-linux-gnu/:/usr/lib/gcc/i486-linux-gnu/4.4.1/:/usr/lib/gcc/i486-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/i486-linux-gnu/4.4.1/:/usr/lib/gcc/i486-linux-gnu/4.4.1/:/usr/lib/gcc/i486-linux-gnu/4.4.1/../../../../lib/:/lib/../lib/:/usr/lib/../lib/:/usr/lib/gcc/i486-linux-gnu/4.4.1/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-I.' '-I../../.ext/include/i686-linux' '-I../.././include' '-I../.././ext/ripper' '-I../..' '-I../../.' '-DRUBY_EXTCONF_H="extconf.h"' '-D_FILE_OFFSET_BITS=64' '-fPIC' '-O2' '-g' '-Wall' '-Wno-parentheses' '-o' 'ripper.o' '-c' '-mtune=generic' '-march=i486'

绝对不知道可能是什么这里出了问题-有什么想法我应该从哪里开始吗?

编辑:fsck 输出

$ sudo fsck -n
fsck 1.40.8 (13-Mar-2008)
e2fsck 1.40.8 (13-Mar-2008)
Warning!  /dev/sda1 is mounted.
Warning: skipping journal recovery because doing a read-only filesystem check.
/dev/sda1 contains a file system with errors, check forced.
Pass 1: Checking inodes, blocks, and sizes
Deleted inode 557058 has zero dtime.  Fix? no

Inodes that were part of a corrupted orphan linked list found.  Fix? no

Inode 557059 was part of the orphaned inode list.  IGNORED.
Inode 557060 was part of the orphaned inode list.  IGNORED.
Inode 557061 was part of the orphaned inode list.  IGNORED.
Inode 557062 was part of the orphaned inode list.  IGNORED.
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Free blocks count wrong (2026992, counted=2014241).
Fix? no

Inode bitmap differences:  -(557058--557062)
Fix? no

Free inodes count wrong (1130174, counted=1129768).
Fix? no


/dev/sda1: ********** WARNING: Filesystem still has errors **********

/dev/sda1: 115010/1245184 files (0.7% non-contiguous), 463376/2490368 blocks

I'm compiling Ruby 1.9.1-p376 under Ubuntu 8.04 server LTS (64-bit), by doing the following:

$ ./configure
$ make
$ sudo make install

./configure works without complaints.

make hangs indefinitely until all my RAM and swap is gone. It get stuck after the following output:

compiling ripper
make[1]: Entering directory `/tmp/ruby1.9.1/ruby-1.9.1-p376/ext/ripper'
gcc -I. -I../../.ext/include/x86_64-linux -I../.././include -I../.././ext/ripper -I../.. -I../../. -DRUBY_EXTCONF_H=\"extconf.h\"    -fPIC  -O2 -g -Wall -Wno-parentheses  -o ripper.o -c ripper.c

If I run the gcc command by hand, with the -v argument to get verbose output, it hangs after the following:

Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.2 --program-suffix=-4.2 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.2.4 (Ubuntu 4.2.4-1ubuntu4)
 /usr/lib/gcc/x86_64-linux-gnu/4.2.4/cc1 -quiet -v -I. -I../../.ext/include/x86_64-linux -I../.././include -I../.././ext/ripper -I../.. -I../../. -DRUBY_EXTCONF_H="extconf.h" ripper.c -quiet -dumpbase ripper.c -mtune=generic -auxbase-strip ripper.o -g -O2 -Wall -Wno-parentheses -version -fPIC -fstack-protector -fstack-protector -o /tmp/ccRzHvYH.s
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/4.2.4/../../../../x86_64-linux-gnu/include"
ignoring nonexistent directory "/usr/include/x86_64-linux-gnu"
ignoring duplicate directory "../.././ext/ripper"
ignoring duplicate directory "../../."
#include "..." search starts here:
#include <...> search starts here:
 .
 ../../.ext/include/x86_64-linux
 ../.././include
 ../..
 /usr/local/include
 /usr/lib/gcc/x86_64-linux-gnu/4.2.4/include
 /usr/include
End of search list.
GNU C version 4.2.4 (Ubuntu 4.2.4-1ubuntu4) (x86_64-linux-gnu)
    compiled by GNU C version 4.2.4 (Ubuntu 4.2.4-1ubuntu4).
GGC heuristics: --param ggc-min-expand=47 --param ggc-min-heapsize=32795
Compiler executable checksum: 6e11fa7ca85fc28646173a91f2be2ea3

I just compiled ruby on another computer for reference, and it took about 10 seconds to print the following output (after the above Compiler executable checksum line):

COLLECT_GCC_OPTIONS='-v' '-I.' '-I../../.ext/include/i686-linux' '-I../.././include' '-I../.././ext/ripper' '-I../..' '-I../../.' '-DRUBY_EXTCONF_H="extconf.h"' '-D_FILE_OFFSET_BITS=64' '-fPIC' '-O2' '-g' '-Wall' '-Wno-parentheses' '-o' 'ripper.o' '-c' '-mtune=generic' '-march=i486'
 as -V -Qy -o ripper.o /tmp/cca4fa7R.s
GNU assembler version 2.20 (i486-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.20
COMPILER_PATH=/usr/lib/gcc/i486-linux-gnu/4.4.1/:/usr/lib/gcc/i486-linux-gnu/4.4.1/:/usr/lib/gcc/i486-linux-gnu/:/usr/lib/gcc/i486-linux-gnu/4.4.1/:/usr/lib/gcc/i486-linux-gnu/:/usr/lib/gcc/i486-linux-gnu/4.4.1/:/usr/lib/gcc/i486-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/i486-linux-gnu/4.4.1/:/usr/lib/gcc/i486-linux-gnu/4.4.1/:/usr/lib/gcc/i486-linux-gnu/4.4.1/../../../../lib/:/lib/../lib/:/usr/lib/../lib/:/usr/lib/gcc/i486-linux-gnu/4.4.1/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-I.' '-I../../.ext/include/i686-linux' '-I../.././include' '-I../.././ext/ripper' '-I../..' '-I../../.' '-DRUBY_EXTCONF_H="extconf.h"' '-D_FILE_OFFSET_BITS=64' '-fPIC' '-O2' '-g' '-Wall' '-Wno-parentheses' '-o' 'ripper.o' '-c' '-mtune=generic' '-march=i486'

I have absolutely no clue what could be going wrong here - any ideas where I should start?

Edit: fsck output

$ sudo fsck -n
fsck 1.40.8 (13-Mar-2008)
e2fsck 1.40.8 (13-Mar-2008)
Warning!  /dev/sda1 is mounted.
Warning: skipping journal recovery because doing a read-only filesystem check.
/dev/sda1 contains a file system with errors, check forced.
Pass 1: Checking inodes, blocks, and sizes
Deleted inode 557058 has zero dtime.  Fix? no

Inodes that were part of a corrupted orphan linked list found.  Fix? no

Inode 557059 was part of the orphaned inode list.  IGNORED.
Inode 557060 was part of the orphaned inode list.  IGNORED.
Inode 557061 was part of the orphaned inode list.  IGNORED.
Inode 557062 was part of the orphaned inode list.  IGNORED.
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Free blocks count wrong (2026992, counted=2014241).
Fix? no

Inode bitmap differences:  -(557058--557062)
Fix? no

Free inodes count wrong (1130174, counted=1129768).
Fix? no


/dev/sda1: ********** WARNING: Filesystem still has errors **********

/dev/sda1: 115010/1245184 files (0.7% non-contiguous), 463376/2490368 blocks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

辞旧 2024-09-08 09:16:23

您需要:

sudo apt-get update
sudo apt-get -y install libc6-dev libssl-dev libmysql++-dev libsqlite3-dev make build-essential libssl-dev libreadline5-dev zlib1g-dev

然后尝试再次安装 ruby​​。

编辑:

您还可以尝试:

sudo apt-get install ruby1.9.1-full

或尝试 1.9.1 的不同版本,

wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.1-p243.tar.gz

看看它是您的机器还是 ruby​​ 代码。

You need to:

sudo apt-get update
sudo apt-get -y install libc6-dev libssl-dev libmysql++-dev libsqlite3-dev make build-essential libssl-dev libreadline5-dev zlib1g-dev

Then try to install ruby again.

EDIT:

you can also try:

sudo apt-get install ruby1.9.1-full

or try a different revision of 1.9.1

wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.1-p243.tar.gz

to see if it's your machine or the ruby code.

满意归宿 2024-09-08 09:16:23

编译 ruby​​-1.9.1-p378 时,我的系统(Ubuntu 8.04)上也出现了完全相同的问题。我回到了早期版本的 ruby​​ (ruby-1.9.1-p243),问题没有出现。尝试一下。

Had the exact same problem on my system (Ubuntu 8.04) when compiling ruby-1.9.1-p378. I went back to an earlier version of ruby (ruby-1.9.1-p243) and the problem did not show up. Give that a try.

深海夜未眠 2024-09-08 09:16:23

我在 CentOS 5.6 和 Ruby 1.9.3 上遇到了这个问题,并尝试了大约一百万件事。最后,我在 CentOS 机器上安装了 apt-get,然后运行:

sudo apt-get update
sudo apt-get upgrade

这升级了以下软件包(以及其他不相关的软件包):

libffi (3.0.5-1.el5 => 3.0.9-1.el5.rf)
libffi-devel (3.0.5-1.el5 => 3.0.9-1.el5.rf)
libyaml (0.1.2-3.el5 => 0.1.4-1.el5.rf)
libyaml-devel (0.1.2-3.el5 => 0.1.4-1.el5.rf)

以某种方式解决了这个问题。

我不知道为什么或如何,但这绝对是最终让 Ruby 安装完成的原因。

I had this issue on CentOS 5.6 with Ruby 1.9.3 and tried about a million things. In the end, I installed apt-get on my CentOS machine and then ran:

sudo apt-get update
sudo apt-get upgrade

This upgraded the following packages (among others that weren't relevant):

libffi (3.0.5-1.el5 => 3.0.9-1.el5.rf)
libffi-devel (3.0.5-1.el5 => 3.0.9-1.el5.rf)
libyaml (0.1.2-3.el5 => 0.1.4-1.el5.rf)
libyaml-devel (0.1.2-3.el5 => 0.1.4-1.el5.rf)

that somehow fixed this.

I have no clue why or how, but it was definitely this that finally allowed the Ruby install to complete.

累赘 2024-09-08 09:16:23

检查文件系统是否损坏。

Check for filesystem corruption.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文