无法安装乘客。 libapr-1.a:无法读取符号:错误的值

时间:2012-03-17 05:06:37

标签: ruby-on-rails ruby passenger apr

我在安装乘客时遇到错误。 #passenger-install-apache2-module

我的环境是

  • CentOS版本5.7(最终版)
  • httpd.x86_64 2.2.3-63.el5.centos.1
  • Phusion Passenger 3.0.11

感谢任何帮助。提前谢谢。


g++ -shared ext/apache2/Configuration.o ext/apache2/Bucket.o ext/apache2/Hooks.o ext/apache2/mod_passenger.o -fPIC -o ext/apache2/mod_passenger.so -fPIC -fvisibility=hidden -DVISIBILITY_ATTRIBUTE_SUPPORTED -Wno-attributes -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -I/usr/include/apr-1 -I/usr/include/apr-1 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing -I/usr/include/httpd -D_REENTRANT -I/usr/local/include -DHASH_NAMESPACE="__gnu_cxx" -DHASH_FUN_H="<ext/hash_fun.h>" -DHAS_ALLOCA_H -DHAS_SFENCE -DHAS_LFENCE -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-long-long -Wno-missing-field-initializers -g -DPASSENGER_DEBUG -DBOOST_DISABLE_ASSERTS ext/apache2/module_libpassenger_common.a ext/apache2/module_libboost_oxt.a -fPIC -lapr-1 -laprutil-1 -lpthread

/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libapr-1.a(apr_strings.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC

/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libapr-1.a: could not read symbols: Bad value

collect2: ld returned 1 exit status

rake aborted!

Command failed with status (1): [g++ -shared ext/apache2/Configuration.o ex...]

Tasks: TOP => apache2 => ext/apache2/mod_passenger.so

1 个答案:

答案 0 :(得分:1)

尝试使用--enable-shared标志重新编译ruby。