取势 明道 优术

作者为 扶 凯 发表

在使用 Gearman::XS 时老是安装不正常,出下面的错

#   Failed test 'use Gearman::XS;'
#   at t/00-use.t line 12.
#     Tried to use 'Gearman::XS'.
#     Error:  Can't load '/root/.cpanm/work/1309399185.2681/Gearman-XS-0.11/blib/arch/auto/Gearman/XS/XS.so' for module Gearman::XS: /root/.cpanm/work/1309399185.2681/Gearman-XS-0.11/blib/arch/auto/Gearman/XS/XS.so: undefined symbol: gearman_worker_add_server at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/DynaLoader.pm line 230.
#  at /root/.cpanm/work/1309399185.2681/Gearman-XS-0.11/blib/lib/Gearman/XS.pm line 175
# BEGIN failed--compilation aborted at /root/.cpanm/work/1309399185.2681/Gearman-XS-0.11/blib/lib/Gearman/XS.pm line 175.
# Compilation failed in require at (eval 4) line 2.
# BEGIN failed--compilation aborted at (eval 4) line 2.
# Testing Gearman::XS 0.11
# Looks like you failed 1 test of 5.
dubious

然后一直查原因

Checking if your kit is complete...
Looks good
Note (probably harmless): No library found for -lgearman
Writing Makefile for Gearman::XS

发现 Gearman::XS 找不到原来的 gearmand 的 lib .所以检查这个的原因看看 gearmand 是安装在哪个位置.

测试了一下真的能解决这个,只要在环境变量中加下这二行,就能找到 lib 的位置了

$ export GEARMAN_LIB=/usr/local/lib/
$ export GEARMAN_INCLUDE=/usr/local/include/

希望你也能正常使用这个…这个模块 force 安装是不可能能正常工作的.

 

来了就留个评论吧! 1个评论



    骡骡 2011年07月1日 的 02:38

    手工编译不利于部署,我一般都是用rpm包

    # rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm
    # rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm

    # yum -y install libgearman libgearman-devel

    # cpan Gearman::XS