Sharing gems with different JRuby versions?

Hello

What is a good/recommended way of sharing gems between different JRuby
versions in OS X/Linux? I’d like to have setup where I can easily
switch between versions, because there are new releases so often and
it would help to test for compatibility issues.

  • Miika

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

I think the best way to do this is to freeze your gems to your project.
Err the Blog has a good writeup about this technique:

He discusses freezing gems in the context of a Rails application, but
his
technique is easy to adapt to any project structure.

There are other benefits of freezing gems to your project (as Err the
Blog
discusses), but I think this will solve your immediate problem.

On 4 Jun 2009, at 06:47, Miika Leppänen wrote:

Hello

What is a good/recommended way of sharing gems between different
JRuby versions in OS X/Linux? I’d like to have setup where I can
easily switch between versions, because there are new releases so
often and it would help to test for compatibility issues.

Neither good, nor recommended, but try adding the directories to
GEM_PATH, e.g.:

export GEM_PATH=/path/to/jruby1.2/lib/ruby/gems/1.8:/path/to/jruby1.3/
lib/ruby/gems/1.8

Use ‘gem environment’ to check that worked.

Damian

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

On 4.6.2009, at 16.11, Damian S. wrote:

Neither good, nor recommended, but try adding the directories to
GEM_PATH, e.g.:

export GEM_PATH=/path/to/jruby1.2/lib/ruby/gems/1.8:/path/to/
jruby1.3/lib/ruby/gems/1.8

Use ‘gem environment’ to check that worked.

Damian

Ok, thanks, this will help.

  • Miika

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

You could just get JRuby right from github and then build it yourself.
That
way you can either stay current with trunk, or just switch your working
copy
to the release that you want. Then your gems can always just stay in
the
same location.

Joe