Closed ryudoawaru closed 1 month ago
This is caused by the build being unable to find JRuby itself. Perhaps this should be smarter when building with JRuby and use the jar file in the current JRuby installation, but I believe the build looks for JRuby under a relative dir like ../jruby
. I'll try to sort that out and add something to docs.
It's this section here trying to sort out the JRuby jar file, I believe:
It first looks in java.class.path
for the JRuby jar, which for me does not appear to contain anything:
$ jruby -e 'puts ENV_JAVA["java.class.path"]'
:
Then it tries to use RbConfig
to find the location of the lib
dir, where the JRuby jar file should be. The same logic for me does find the JRuby jar:
$ jruby -rrbconfig -e 'p File.exist?(RbConfig::CONFIG["libdir"] + "/jruby.jar")'
true
@ryudoawaru Could you try these snippits of code on your rvm JRuby installation and see if they find the jruby.jar file?
In my local machine(rvm + jruby 9480)
➜ ~ ruby -e 'puts ENV_JAVA["java.class.path"]'
/Users/ryudo/.rvm/rubies/jruby-9.4.8.0/lib/ojdbc11.jar:
➜ ~ jruby -rrbconfig -e 'p File.exist?(RbConfig::CONFIG["libdir"] + "/jruby.jar")'
true
true
➜ ~ ls /Users/ryudo/.rvm/rubies/jruby-9.4.8.0/lib/
jni jruby.jar ojdbc11.jar ruby
➜ ~ whereis javac
javac: /usr/bin/javac /opt/homebrew/opt/openjdk@21/share/man/man1/javac.1
However I found I can finish building gem in 9.4.8.0-jdk21
docker image.
When I checkout the source from this repo and try to build jar:
➜ activerecord-jdbc-adapter git:(master) jruby -S rake jar
I encountered following error:
I also can install this gem by neither adding the source into Gemfile not
gem speicfic install
.