You can clone with
HTTPS or Subversion.
First of all, the error itself:
$ bundle exec rake -T
load error: pg_ext -- java.lang.RuntimeException: C extension initialized against invalid ruby runtime
On our project we are running on gem pg_power (which is compatible only with pg gem and not with jdbc adapter). For clearance we tested with mysql2 gem and get the same result.
After bisecting we found that the problem is caused by: 3b8b934
To reproduce the bug you can use: jruby_ffi_regression_test
@headius can you please take a look?
This looks like a problem with cext, not FFI.
We are getting a similar error trying to use foreman. The exception is the same, except it references the posix_spawn_ext gem rather than pg_ext.
It was working fine for us in 1.7.0.
Unfortunately C extension support is no longer supported. We plan to spin it off as an external project that users can maintain if they so desire.
The issue here looks like you've got multiple JRuby instances in one JVM and more than one of them is trying to load C extensions. The MRI C ext API is 100% incompatible with multiple JRuby instances in the same process, due to their use of C-level global variables and inability to know which instance is making a call into C. Could you perhaps be booting multiple JRuby instances? Maybe you're running Trinidad, which spins up multiple instances by default?
For us, we were just running a "foreman start". I'm not really sure what posix-spawn does internally, but I suppose it is possible it is somehow starting multiple copies of JRuby.
@headius yep, you are right, we are using puma which runs a bunch of jRuby instances
The C extension support has moved to https://github.com/jruby/jruby-cext. If you are still having a problem, please recreate this issue there. However I believe the general opinion is that the core team does not have the resources to maintain C extension support at the moment. Sorry.