I'm developing a gem that is compatible with JRuby and MRI without cross-compiling. I discovered that running bundle install
on JRuby changes Gemfile.lock
.
And when I run bundle install
on MRI, Gemfile.lock
doesn't change back. But everything goes as expected. MRI bundler didn't try to install the new dependencies added by JRuby.
How does bundler know that it shouldn't install those even if I didn't mention it?
Is it safe to have a single Gemfile.lock
for both JRuby and MRI?
that's fine and what you want. re-running bundle
under MRI will be OK. so simply commit that into git and maybe re-run bundle under both Rubies when its changed.
support for having gem dependencies relative to platform (as some gems might be native) has landed around Bundler 1.16 so make sure you're not using an older version.