2017-08-04 109 views
-1

Linux的版本是:2.6.18-308.el5在Linux的源代码安装Ruby 2.4.1

一个Ruby版本1.8.5已经安装了

我的命令:

./configure --prefix=/home/user_a/local

使

Csh:$ make 
CC = gcc 
LD = Id 
LDSHARED = gcc -shared 
CFLAGS = -03 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter - 
Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable 
-Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -W 
implicit-function-declaration -Wdeprecated-declarations -std=gnu99 
XCFLAGS = -D_F0RTIFY_S0URCE=2 -fstack-protector -fvisibility=hidden -DRU 
BY_EXP0RT -fPIE ~ ~ 
CPPFLAGS = -I. -I.ext/include/x86_64-linux -I./include -I. -I./enc/uni 
code/9.0.0 
DLDFLAGS = -fstack-protector -pie 
SOLIBS = -Igmp 
gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-52) 
Copyright (C) 2006 Free Software Foundation, Inc. 
This is free software; see the source for copying conditions. There is NO 
warranty; not even fo「 MERCHANTABILITY 〇「 FITNESS FOR A PARTICULAR PURPOSE. 
generating id.h 
./tool/generic_erb.rb:31: syntax error 
if (/\A\e\[.*m\z/ =〜10.popenC'tput smso11, err: 10: :NULL, &:read> rescue 
nil) 
/s 
./tool/generic_erb.rb:31: syntax error 
if (/\A\e\[.*m\z/ =〜10.popenC'tput smso11, err: 10: :NULL, &:read> rescue 
nil) 
/s 
./tool/generic_erb.rb:31: syntax error 
if (/\A\e\[.*m\z/ =〜10.popenC'tput smso11, err: 10: :NULL, &:read> rescue 
nil) 
./tool/generic_erb.rb:38: syntax error 
make: *** [id.h] Error 1 

命令使募集错误:

Command Error Picture

这是否意味着Ruby在安装新版本时需要安装版本......? 我不是管理员,没有删除权限1.8.5 如何在此附近走走?

感谢

+1

你的电脑多大了? Ruby'1.8.5' [在** 2006发布**](https://www.ruby-lang.org/zh/news/2006/08/29/ruby-1-8-5-released/) ;多年来我一直在使用该语言,甚至没有看到过这种旧的安装!即使[下载链接已死](https://cache.ruby-lang.org/pub/ruby/ruby-1.8.5.tar.gz)。 –

+0

无论如何...重要的问题:是否有一个很好的理由,你为什么像这样从源代码安装ruby?通过[rbenv](https://github.com/rbenv/rbenv#installation)或[rvm](https://rvm.io/rvm/install)安装多个ruby版本是正常的。 –

+0

谢谢汤姆。 1.8.5版本是Linux系统的默认版本,Linux版本是旧的。电脑离线,无法访问互联网... –

回答

0

在有关编译一个Ruby版本如有疑问,您可以使用版本管理器,像rbenvrvm会更好。

如果不是这种情况下,应尽可能从the official source和运行下载非常简单:

$ ./configure 
$ make 
$ sudo make install 

而如果你想另一个目录比默认目录(/ usr /本地),你可以只通过,如你所说,--prefix=DIR./configure