Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [user@centos-vm ~]$ jruby -S irb
- irb(main):001:0> require 'ffi'
- => true
- irb(main):002:0>
- irb(main):003:0* module Foo
- irb(main):004:1> extend FFI::Library
- irb(main):005:1> ffi_lib 'xml2', 'xslt', 'exslt'
- irb(main):006:1> end
- LoadError: Failed to load library 'xml2': Could not open library 'libxml2.so' : libxml2.so: cannot open shared object file: No such file or directory\nFailed to load library 'xslt': Could not open library 'libxslt.so' : libxslt.so: cannot open shared object file: No such file or directory\nFailed to load library 'exslt': Could not open library 'libexslt.so' : libexslt.so: cannot open shared object file: No such file or directory
- from /usr/local/jruby/lib/ruby/site_ruby/shared/ffi/library.rb:24:in `ffi_lib'
- from (irb):6
- irb(main):007:0>
- irb(main):008:0* p Foo.ffi_libraries.collect { |lib| lib.name }
- [nil]
- => nil
- irb(main):009:0>
- # CentOS 5.4 doesn't have just "libxml2.so" for some reason.
- [user@centos-vm ~]$ cd /usr/lib
- [user@centos-vm lib]$ su
- Password:
- [root@centos-vm lib]# ln -s libxml2.so.2 libxml2.so
- [root@centos-vm lib]# exit
- [user@centos-vm lib]$ jruby -S irb
- irb(main):001:0> require 'ffi'
- => true
- irb(main):002:0>
- irb(main):003:0* module Foo
- irb(main):004:1> extend FFI::Library
- irb(main):005:1> ffi_lib 'xml2', 'xslt', 'exslt'
- irb(main):006:1> end
- => [#<FFI::DynamicLibrary:0x174f02c>]
- irb(main):007:0>
- irb(main):008:0* p Foo.ffi_libraries.collect { |lib| lib.name }
- ["libxml2.so"]
- => nil
- irb(main):009:0>
Add Comment
Please, Sign In to add comment