Guest User

Untitled

a guest
Jul 19th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. [user@centos-vm ~]$ jruby -S irb
  2. irb(main):001:0> require 'ffi'
  3. => true
  4. irb(main):002:0>
  5. irb(main):003:0* module Foo
  6. irb(main):004:1> extend FFI::Library
  7. irb(main):005:1> ffi_lib 'xml2', 'xslt', 'exslt'
  8. irb(main):006:1> end
  9. 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
  10. from /usr/local/jruby/lib/ruby/site_ruby/shared/ffi/library.rb:24:in `ffi_lib'
  11. from (irb):6
  12. irb(main):007:0>
  13. irb(main):008:0* p Foo.ffi_libraries.collect { |lib| lib.name }
  14. [nil]
  15. => nil
  16. irb(main):009:0>
  17.  
  18. # CentOS 5.4 doesn't have just "libxml2.so" for some reason.
  19.  
  20. [user@centos-vm ~]$ cd /usr/lib
  21. [user@centos-vm lib]$ su
  22. Password:
  23. [root@centos-vm lib]# ln -s libxml2.so.2 libxml2.so
  24. [root@centos-vm lib]# exit
  25.  
  26.  
  27. [user@centos-vm lib]$ jruby -S irb
  28. irb(main):001:0> require 'ffi'
  29. => true
  30. irb(main):002:0>
  31. irb(main):003:0* module Foo
  32. irb(main):004:1> extend FFI::Library
  33. irb(main):005:1> ffi_lib 'xml2', 'xslt', 'exslt'
  34. irb(main):006:1> end
  35. => [#<FFI::DynamicLibrary:0x174f02c>]
  36. irb(main):007:0>
  37. irb(main):008:0* p Foo.ffi_libraries.collect { |lib| lib.name }
  38. ["libxml2.so"]
  39. => nil
  40. irb(main):009:0>
Add Comment
Please, Sign In to add comment