In order for JRuby to find the native PDFNetC library (PDFNetC.dll, libPDFNetC.so, libPDFNetC.dylib), it must be placed at the correct locations:
Windows:
- Any of the directories specified in PATH environment variable.
- Inside %WINDIR%\System32
Linux:
- In /usr/lib or its derivatives (i.e. /usr/local/lib)
- Any of the directories specified in LD_LIBRARY_PATH environment variable.
Mac:
- Copy libPDFNetC.dylib to /Library/Java/Extensions/libPDFNetC.jnilib.
In addition to any of the above, an alternative way of specifying where the native library resides is by adding -J-Djava.library.path option to jruby (of course, this will only work when running from command line interface).
The file PDFNet.jar must also be placed in the lib folder of JRuby.