在尝试安装ruby 1.9.2时,我收到错误:
Error running 'make -j8', please read $HOME/.rvm/log/ruby-1.9.2-p320/1372884536_make.log There has been an error while running make. Halting the installation.
然后日志说:
gcc: Internal error: Killed (program cc1) Please submit a full bug report. See for instructions. gcc: Internal error: Killed (program cc1) Please submit a full bug report. See for instructions. make[1]: *** [callback-5.o] Error 1 make[1]: *** Waiting for unfinished jobs.... make[1]: *** [callback-4.o] Error 1 gcc: Internal error: Killed (program cc1) Please submit a full bug report. See for instructions. make[1]: *** [callback-2.o] Error 1 make[1]: Leaving directory `$HOME/.rvm/src/ruby-1.9.2-p320/ext/dl/callback' make: *** [mkmain.sh] Error 1
知道我为什么会收到这个错误吗?我正在运行Debian 5.0.9 lenny
答案:
我发现问题在于使用8个线程运行make(make -j8)。由于某种原因,这不适用于我的系统。为了解决这个问题,我在运行rvm install 1.9.2
之前运行了以下函数:
make() { if [[ $@ == "-j8" ]]; then command make -j4; else command make "$@"; fi; }
这样做只是在make -j8
运行时,该函数会将其替换为make -j4
如果这仍然不起作用,您可以使用以下函数正常运行make:
make() { if [[ $@ == "-j8" ]]; then command make; else command make "$@"; fi; }
答案 0 :(得分:2)
默认情况下,RVM使用的线程数等于CPU内核的数量,您可以在命令行上覆盖线程数:
rvm install 1.9.2 -j 1
这将仅使用一个线程来编译ruby,并且如果编译因多线程而失败,则看起来最安全。