Rails3+bundler where team wants to use both MRI + JRuby

hi,

I need some solution where we as a team can work with a rails3
application both with MRI and JRuby. the currently the Gemfile.lock is
on github and the jruby people need to follow this mantra:

  • first delete Gemfile.lock and then start your work
  • never ever check in th Gemfile.lock

well another possibility would be no Gemfile.lock on github and
everyone keeps it local.

but both procedures seems to contradict the idea of Gemfile.lock

is there something I miss or s simple solution to the problem ?

regards Kristian

You can qualify the differences in gems between the different platforms
with a “platforms” block in your Gemfile. The resulting Gemfile.lock
should then work on both MRi and JRuby.

On 2010-10-31, at 14:55, kristian wrote:

everyone keeps it local.
http://xircles.codehaus.org/manage_email


With kind regards
Uwe K.
Kubosch Consulting
[email protected]

On 10/31/2010 11:54 PM, Uwe K. wrote:

You can qualify the differences in gems between the different
platforms with a “platforms” block in your Gemfile. The resulting
Gemfile.lock should then work on both MRi and JRuby.

However, that’s not the whole story. A seperate group for MRi and JRuby
is nice and dandy, but my :development group contains ruby-debug gems.
These need to be excluded from production, but also from JRuby, because
their native parts won’t compile. In theory it should be possible to add
:platforms => ‘jruby’ after the gem and version, but in practice, I
haven’t gotten this to work and currently we end up with ruby_debug gems
in production :/.

All gems, for both platforms, will still be installed when you execute a
bundle install or a jruby -S bundle install and the latter one will fail
when trying to install gems with C extensions.

best regards,

Ivo W.

I found a work around for this. See here:

http://groups.google.com/group/ruby-bundler/msg/7a9c1d183570ff8b