2017-08-04 107 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