I think this won't work, because the `Gemfile.lock` will be different between the two platforms, which will break things. (At least, that's true if you conditionalize in a `Gemfile`, and I think this will behave the same way)

`gem` in a `Gemfile` has a `:platform` option or some such -- does `add_runtime_dependency`? I'm also a little confused, because I'm pretty sure the BSON gem does ship a Java implementation for `JRuby`, so I'd expect this to work. It might be worth digging a little more or seeing if there are docs for what you're supposed to do here.