Skip to content

Upgrading Ruby with Moonshine

ches edited this page Aug 19, 2010 · 16 revisions

Moonshine supports installing several versions of Ruby easily out of the box, according to the value of the :ruby: key set in config/moonshine.yml. If you wish to upgrade or change the version installed when you initially deployed your server, it’s as simple as:

  1. Update the :ruby: value in your config/moonshine.yml (see options below)
  2. cap staging ruby:upgrade # test the installation, and test your app, on staging!
  3. cap production ruby:upgrade

The current options for the :ruby: are:

ree (default) Ruby Enterprise Edition 1.8.6-20090610
ree187 Ruby Enterprise Edition 1.8.7-2010.02
mri The ruby version available in Ubuntu from apt
src187 MRI 1.8.7-p249 compiled from source

Providing a Custom Ruby

Adding your own custom Ruby version is possible by setting :ruby: my_custom_ruby and defining your own cap task in the ruby namespace within your recipes:

namespace :ruby do
  task :my_custom_ruby do
    remove_ruby_from_apt
    # fetch, compile, whatever you need to do
  end
end

You can have a look at the built-in tasks for examples.

Clone this wiki locally