新手问题 ubuntu 下利用 rbenv 安装 ruby 报错

roar · 2015年06月11日 · 最后由 hbin 回复于 2015年06月11日 · 2369 次阅读

系统:ubuntu ruby: 1.9.3(因为之前项目就采用这个版本,虽然已经过时了) 安装工具:rbenv 安装信息:

Downloading yaml-0.1.6.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/7da6971b4bd08a986dd2a61353bc422362bd0edcc67d7ebaac68c95f74182749
Installing yaml-0.1.6...
Installed yaml-0.1.6 to /home/kongshuai/.rbenv/versions/1.9.3-p551

Downloading ruby-1.9.3-p551.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/bb5be55cd1f49c95bb05b6f587701376b53d310eb1bb7c76fbd445a1c75b51e8
Installing ruby-1.9.3-p551...

BUILD FAILED (Ubuntu 14.10 using ruby-build 20150519-5-g09deea0)

Inspect or clean up the working tree at /tmp/ruby-build.20150611144856.17023
Results logged to /tmp/ruby-build.20150611144856.17023.log

Last 10 log lines:
make[1]: *** 正在等待未完成的任务....
compiling date_strftime.c
installing default date_core libraries
linking shared-object bigdecimal.so
make[2]: Leaving directory '/tmp/ruby-build.20150611144856.17023/ruby-1.9.3-p551/ext/bigdecimal'
linking shared-object date_core.so
make[2]: Leaving directory '/tmp/ruby-build.20150611144856.17023/ruby-1.9.3-p551/ext/date'
make[1]: Leaving directory '/tmp/ruby-build.20150611144856.17023/ruby-1.9.3-p551'
uncommon.mk:178: recipe for target 'build-ext' failed
make: *** [build-ext] Error 2

查看具体的编译日志(只截取了最后报错的部分)

compiling md5init.c
compiling date_core.c
compiling md5ossl.c
installing default md5 libraries
linking shared-object digest/md5.so
/usr/bin/ld: /usr/local/lib/libcrypto.a(md5_dgst.o): relocation R_X86_64_PC32 against 符号 `md5_block_asm_data_order' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: 最终连接失败: 错误的值
collect2: error: ld returned 1 exit status
Makefile:216: recipe for target '../../../.ext/x86_64-linux/digest/md5.so' failed
make[2]: *** [../../../.ext/x86_64-linux/digest/md5.so] Error 1
make[2]: Leaving directory '/tmp/ruby-build.20150611144856.17023/ruby-1.9.3-p551/ext/digest/md5'
exts.mk:80: recipe for target 'ext/digest/md5/all' failed
make[1]: *** [ext/digest/md5/all] Error 2
make[1]: *** 正在等待未完成的任务....
compiling date_strftime.c
installing default date_core libraries
linking shared-object bigdecimal.so
make[2]: Leaving directory '/tmp/ruby-build.20150611144856.17023/ruby-1.9.3-p551/ext/bigdecimal'
linking shared-object date_core.so
make[2]: Leaving directory '/tmp/ruby-build.20150611144856.17023/ruby-1.9.3-p551/ext/date'
make[1]: Leaving directory '/tmp/ruby-build.20150611144856.17023/ruby-1.9.3-p551'
uncommon.mk:178: recipe for target 'build-ext' failed
make: *** [build-ext] Error 2

纠结了好久了,请各位指点一下!

Ubuntu 12.04+ :rbenv bootstrap-ubuntu-12-04 Ubtunu 10.04 : rbenv bootstrap-ubuntu-10-04

需要 登录 后方可回复, 如果你还没有账号请 注册新账号