简体   繁体   English

在Linux服务器上安装ruby 1.9.3时出错

[英]error installing ruby 1.9.3 on linux server

Hey I'm just to update ruby on a linux server I ssh into. 嘿,我只是要在ssh进入的Linux服务器上更新ruby。 I know there a lot of threads on this but most are for installing on mac osx (which i dont have an issue with). 我知道这里有很多线程,但是大多数都是用于在Mac OS X上安装的(我没有遇到任何问题)。 This is the error log thats outputted: 这是输出的错误日志:

$ rvm install 1.9.3
ruby-1.9.3-p551 - #removing src/ruby-1.9.3-p551..
Searching for binary rubies, this might take some time.
No binary rubies available for: unknown/libc-2.12/x86_64/ruby-1.9.3-p551.
Continuing with compilation. Please read 'rvm help mount' to get more 
information on binary rubies.
Checking requirements for unknown.
Install:
press any key to continue
Install: build-essential libreadline zlib1g libyaml libc6 libgdbm ncurses
press any key to continue
Requirements installation successful.
Installing Ruby from source to: /home/swampu6/.rvm/rubies/ruby-1.9.3-p551, this may take a while depending on your cpu(s)...
ruby-1.9.3-p551 - #downloading ruby-1.9.3-p551, this may take a while depending on your connection...
ruby-1.9.3-p551 - #extracting ruby-1.9.3-p551 to /home/swampu6/.rvm/src/ruby-1.9.3-p551....
ruby-1.9.3-p551 - #applying patch /home/swampu6/.rvm/patches/ruby/GH-488.patch.
ruby-1.9.3-p551 - #applying patch /home/swampu6/.rvm/patches/ruby/1.9.3/CVE-2015-1855-p484.patch.
ruby-1.9.3-p551 - #configuring.............................................
ruby-1.9.3-p551 - #post-configuration..
ruby-1.9.3-p551 - #compiling...
Error running '__rvm_make -j48',
showing last 15 lines of /home/swampu6/.rvm/log/1437856022_ruby-1.9.3-p551/make.log
    XCFLAGS = -include ruby/config.h -include ruby/missing.h -fvisibility=hidden -DRUBY_EXPORT
    CPPFLAGS =   -I. -I.ext/include/x86_64-linux -I./include -I.
    DLDFLAGS = -Wl,-soname,libruby.so.1.9
    SOLIBS = -lpthread -lrt -ldl -lcrypt -lm
compiling main.c
compiling dmydln.c
compiling dmyencoding.c
compiling version.c
compiling miniprelude.c
compiling array.c
compiling bignum.c
make: vfork: Resource temporarily unavailable
make: vfork: Resource temporarily unavailable
compiling dmyversion.c
++ return 2
There has been an error while running make. Halting the installation.

this is the content of the make.log per a commenter's request: 这是每个评论者请求的make.log内容:

[2015-07-25 16:27:22] __rvm_make
__rvm_make ()
{
    \make "$@" || return $?
}
current path: /home/swampu6/.rvm/src/ruby-1.9.3-p551
PATH=/usr/kerberos/bin:/home/swampu6/perl5/bin:/usr/lib/courier-imap/bin:/usr/local/bin:/bin:/usr/bin:/opt/dell/srvadmin/bin:/home/swampu6/.rvm/bin:/home/swampu6/bin:/home/swampu6/.rvm/bin
command(2): __rvm_make -j48
++ make -j48
    CC = gcc
    LD = ld
    LDSHARED = gcc -shared
    CFLAGS = -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration  -fPIC
    XCFLAGS = -include ruby/config.h -include ruby/missing.h -fvisibility=hidden -DRUBY_EXPORT
    CPPFLAGS =   -I. -I.ext/include/x86_64-linux -I./include -I.
    DLDFLAGS = -Wl,-soname,libruby.so.1.9
    SOLIBS = -lpthread -lrt -ldl -lcrypt -lm
compiling main.c
compiling dmydln.c
compiling dmyencoding.c
compiling version.c
compiling miniprelude.c
compiling array.c
compiling bignum.c
make: vfork: Resource temporarily unavailable
make: vfork: Resource temporarily unavailable
compiling dmyversion.c
++ return 2

I think your issue is that, since RVM is trying to compile ruby with the command __rvm_make -j48 (which tells the compiler to try to parallelize the compilation across 48 different jobs), your host system is running out of space to do so. 我认为您的问题是,由于RVM试图使用__rvm_make -j48命令(它告诉编译器尝试并行处理48个不同作业的并行化)来编译ruby,因此您的主机系统空间不足。 Before I get to a possible solution, here are some high-level thoughts: 在我寻求一种可能的解决方案之前,这里有一些高级思考:

  1. Production systems generally shouldn't be compiling their own Ruby versions. 生产系统通常不应该编译自己的Ruby版本。 Instead, ship the compiled binaries to the node (eg, as a Debian package) and don't even install RVM. 取而代之的是,将编译的二进制文件运送到该节点(例如,作为Debian软件包),甚至不安装RVM。

  2. rvm does a lot of magic to try and hide the details of what its doing from the end-user, but in my experience that's more trouble than it's worth. rvm尝试了很多技巧,试图向最终用户隐藏其操作的详细信息,但以我的经验,这比其价值更大。 Use chruby or rbenv and build Ruby only when you need to. 仅在需要时使用chrubyrbenv并构建Ruby。

Anyway, for your current issue, I think your best bet is to try to override the -j flag to a smaller value. 无论如何,对于您当前的问题,我认为您最好的选择是尝试将-j标志覆盖为较小的值。 There are a few methods, but first try this: 有几种方法,但是先尝试一下:

rvm install 1.9.3 -j 1                # from http://cheat.errtheblog.com/s/rvm

If that doesn't help, double-check that the -j argument in __rvm_make -j 48 actually changed to 1 in the log. 如果那没有帮助,请仔细检查__rvm_make -j 48中的-j参数实际上是否在日志中更改为1。 If it did, try a smaller number. 如果是这样,请尝试使用较小的数字。 If it didn't, then try this: 如果没有,请尝试以下操作:

MAKEFLAGS=-j1 rvm install ruby-1.9.3  # from https://twitter.com/avdi/status/130720270733410305

Hopefully one of those works! 希望这些作品之一!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM