hp-ux ruby调用oci错误之解决过程

阅读更多
今天在hp-ux 11.11 pa平台安装ruby和oci8,ruby版本为1.8.6-p114,安装过程一切正常,但安装完成后执行irb校验时报如下错误
引用
$ irb
irb(main):001:0> require 'oci8'
LoadError: Can't dlopen() a library containing Thread Local Storage: /usr/lib/libpthread.1 - /ora10gdata/dbra/app/lib/ruby/lib/ruby/site_ruby/1.8/hppa2.0w-hpux11.11/oci8lib.sl
        from /ora10gdata/dbra/app/lib/ruby/lib/ruby/site_ruby/1.8/hppa2.0w-hpux11.11/oci8lib.sl
        from /ora10gdata/dbra/app/lib/ruby/lib/ruby/site_ruby/1.8/oci8.rb:20
        from (irb):1:in `require'
        from (irb):1
irb(main):002:0> exit

一般碰到此类问题,都较难解决,尤其在万恶的hp平台上。解决过程如下:
1、删除ruby,oci8
2、重新安装ruby,注意添加环境变量和修改Makefile关键步骤
引用
gunzip ruby-1.8.6-p114.tar.gz
export LDOPTS="+s -L/usr/local/lib -L/usr/local/lib/hpux32"
export CFLAGS="-lcl -lpthread"
./configure --prefix=/ora10gdata/dbra/app/lib/ruby*
修改Makefile
LIBS = -ldld -lcrypt -lm -lcl $(EXTLIBS)
gmake
gmake install

3、再次安装oci8

你可能感兴趣的:(HP,Ruby,thread)