Currently the gem is using RUBY_PLATFORM to get the OS, so it can pick the right binary. On JRuby, this is always "java", because it's the only way we can differentiate gems for our platform:
$ jruby -e 'p RUBY_PLATFORM'
"java"
This prevents commands from working:
$ wkhtmltopdf
RuntimeError: Invalid platform. Must be running linux or intel-based Mac OS.
<main> at /Users/headius/projects/jruby/lib/ruby/gems/shared/gems/wkhtmltopdf-0.1.2/bin/wkhtmltopdf:8
load at org/jruby/RubyKernel.java:1022
<main> at /Users/headius/projects/jruby/bin/wkhtmltopdf:23
However we do support the (arguably more reliable) RbConfig::CONFIG['host_os'] which should work the same way for you:
Currently the gem is using
RUBY_PLATFORM
to get the OS, so it can pick the right binary. On JRuby, this is always "java", because it's the only way we can differentiate gems for our platform:This prevents commands from working:
However we do support the (arguably more reliable)
RbConfig::CONFIG['host_os']
which should work the same way for you:Changing the bin script to use this value instead of RUBY_PLATFORM would allow the gem to work on JRuby:
👍