ruby1.9.3安装出错

Callen 发布于 2013/12/19 21:06
阅读 1K+
收藏 0

我是用的系统是centos,我先在需要为它安装rails,但是rails需要ruby的最低版本为1.9.8,而centos源提供的最高版本为1.8.7,所以我只能通过编译安装ruby.

这是我的执行步骤:

wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p0.tar.gz

tar -zxf ruby-1.9.3-p0.tar.gz

cd ruby-1.9.3-p0

./configure --prefix=/usr/local --enable-shared --enable-pthread --disable-install-doc --with-opt-dir=/usr/local/lib

make

make install

这是报错:

make :

[root@localhost ruby-1.9.3-p0]# make
    CC = gcc
    LD = ld
    LDSHARED = gcc -shared
    CFLAGS = -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Werror=pointer-arith -Werror=write-strings -Werror=declaration-after-statement -Werror=implicit-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  
linking shared-library libruby.so.1.9.1
/usr/bin/ld: dln.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
dln.o: could not read symbols: Bad value
collect2: ld 返回 1
make: *** [libruby.so.1.9.1] 错误 1

make install:

[root@localhost ruby-1.9.3-p0]# make install
./miniruby -I./lib -I. -I.ext/common  ./tool/rbinstall.rb --make="make" --dest-dir="" --extout=".ext" --mflags="" --make-flags="" --data-mode=0644 --prog-mode=0755 --installed-list .installed.list --mantype="doc"
installing binary commands:   /usr/local/bin
/root/ruby-1.9.3-p0/lib/fileutils.rb:1515:in `stat': No such file or directory - ruby (Errno::ENOENT)
    from /root/ruby-1.9.3-p0/lib/fileutils.rb:1515:in `block in fu_each_src_dest'
    from /root/ruby-1.9.3-p0/lib/fileutils.rb:1529:in `fu_each_src_dest0'
    from /root/ruby-1.9.3-p0/lib/fileutils.rb:1513:in `fu_each_src_dest'
    from /root/ruby-1.9.3-p0/lib/fileutils.rb:854:in `install'
    from ./tool/rbinstall.rb:156:in `install'
    from ./tool/rbinstall.rb:317:in `block in <main>'
    from ./tool/rbinstall.rb:597:in `call'
    from ./tool/rbinstall.rb:597:in `block (2 levels) in <main>'
    from ./tool/rbinstall.rb:594:in `each'
    from ./tool/rbinstall.rb:594:in `block in <main>'
    from ./tool/rbinstall.rb:590:in `each'
    from ./tool/rbinstall.rb:590:in `<main>'
make: *** [do-install-nodoc] 错误 1


求助大神呀。



加载中
返回顶部
顶部