Recommended upgrade method

I have JRuby 1.1.3 with about 20 gems. It’s sitting somewhere under
$HOME, which I prepend to $PATH in order to invoke jruby.

Now, I want to upgrade to 1.1.4, but I do not want to re-install all
the gems that I have with 1.1.3. I could copy lib/ruby/gems/1.8 to
the corresponding directory for the 1.1.4 binary distribution, but
that will miss stuff in bin, such as ‘warble’, ‘rails’ and ‘rdebug’.

What is the recommended method to upgrade?

Hiro


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Hirotsugu A. wrote:

I have JRuby 1.1.3 with about 20 gems. It’s sitting somewhere under
$HOME, which I prepend to $PATH in order to invoke jruby.

Now, I want to upgrade to 1.1.4, but I do not want to re-install all the
gems that I have with 1.1.3. I could copy lib/ruby/gems/1.8 to the
corresponding directory for the 1.1.4 binary distribution, but that will
miss stuff in bin, such as ‘warble’, ‘rails’ and ‘rdebug’.

What is the recommended method to upgrade?

This is a bit of an open question these days. The safest method is
probably “reinstall gems into new JRuby”. If you have a lot, that’s
obviously painful. It might be possible to just copy new JRuby over the
top of old JRuby, but I’ve never tried it. I think we’re open to
suggestions on how to make it easier to upgrade JRuby when you’ve got an
existing install and lots of gems installed.

Any thoughts?

  • Charlie

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

I am wondering why it wouldn’t work to add the path to the old
repository to the GEM_PATH. I thought could be used to specify the paths
to alternative gem repositories. When the interpreter does not find a
gem in the platform’s gem repository, I believe it searches the
repositories that are specified in GEM_PATH.

Charles Oliver N. wrote:


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Chris K. wrote:

One of the things I have taken to doing is creating a mega gem that is
my gem for the current project I am working on and keep all the other
gem dependencies in it (Ian D. originally suggested this to me).
Then rebuilding the environment is pretty easy. This does not fix any
compatibility issues, but it makes the processes a whole lot easier.

I have not figured out if there is an equivalent for this for plugins
for rails.

–Bob

the top of old JRuby, but I’ve never tried it. I think we’re open to
http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

That’s a really good idea; I’d love to see someone come up with such a
tool for aiding migrations. Basically run a command on the old Ruby dist
and it outputs a gem that depends on everything installed. Run the
install against that gem on the new system, and voile, you’re all set.
I’d almost think such a feature should be added to RubyGems itself.

Bob L. wrote:

Charles Oliver N. wrote:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Here’s a one-liner to get the current gems, in the form of a
gem-install command:

james-moores-macbook-pro:caclr jamesmoore$ gem list | cut -f 1 -d ’ ’
| grep -v -e ‘***’ | xargs echo sudo gem install
gem install actionmailer actionpack actionwebservice activerecord
activeresource activesupport acts_as_ferret capistrano
cgi_multipart_eof_fix daemons dnssd fastthread fcgi ferret gem_plugin
highline hoe hpricot libxml-ruby mislav-will_paginate mongrel needle
net-sftp net-ssh open4 rails rake RedCloth ruby-openid ruby-yadis
rubyforge rubygems-update rubynode sqlite3-ruby termios vlad
james-moores-macbook-pro:caclr jamesmoore$

You might want to copy the old gem cache directory to the new one
(lib/ruby/gems/1.8/cache/*). That should save some downloading time.


James M. | [email protected]
Ruby and Ruby on Rails consulting
blog.restphone.com


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Matt Fletcher wrote:

I’ve been using this technique for every single Ruby project I’ve done -
whether it be Rails or not - with good success. It has made upgrading my
JRuby distribution (mostly) painless.

This is also probably good advice for folks looking to do unusual JRuby
on Rails packages; since RubyGems does not work so well from within an
archive (due to it using File APIs we have not yet made work perfectly
within a jar) in most cases if you want to distribute a project that has
gem-based dependencies you need to “vendor them”, so to speak, but
pulling the gem guts into e.g. site_ruby or some other directory you can
add to the load path.

  • Charlie

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Not sure if this technique will help the original poster, but it seems
like
its worth mentioning anyway.
Err the Blog talks about vendoring everything:

Basically keep your gems and other dependences in a vendor directory
that’s
part of the project and not part of your Ruby distribution. The article
is
relevant in the context of both Rails and non-Rails applications.

I’ve been using this technique for every single Ruby project I’ve done -
whether it be Rails or not - with good success. It has made upgrading my
JRuby distribution (mostly) painless.

On Sun, Aug 31, 2008 at 3:59 PM, Charles Oliver N. <

I tried the vendor everything route a couple months ago and didn’t get
anywhere.

I also grew tired of waiting for the internets etc., so I took the
simple route and just checked the .gem files into source control and
wrote a shell script to install them:

http://tinyurl.com/6kwc3o

Certainly not the most elegant, but it works :slight_smile:

Mike H.
Program Manager, Collaborative Software Initiative
[email protected]
http://www.csinitiative.com

Matt Fletcher wrote:

I’ve been using this technique for every single Ruby project I’ve done -
you’re all set. I’d almost think such a feature should be added to
suggested this to me). Then rebuilding the environment is
I am wondering why it wouldn’t work to add the path to the
I have JRuby 1.1.3 with about 20 gems. It’s sitting
What is the recommended method to upgrade?

    To unsubscribe from this list, please visit:

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email