3uvl2w
Last Updated: February 25, 2016
·
2.54K
· braincomb
D25d424caa1bb57f7497e6ea90b23e10

Upgrading Ruby on FreeBSD

Recently I have had the pleasure of upgrading from end-of-life FreeBSD 7.0 to the latest 9.1. Along with it, I needed to upgrade to the latest Ruby 1.9.3 and recompile all packages that depended on it. Here's what you need to do:

portsnap fetch
portsnap update
cd /usr/ports/lang/ruby19
make install clean

Now that we have latest Ruby, let's rebuild all dependent packages. First, let's add default Ruby version to make.conf:

echo "RUBY_DEFAULT_VER=1.9" >> /etc/make.conf

Then, you need to disable Mongrel back-end from rubygem-rails because Mongrel will NOT work with 1.9, besides, you shouldn't be using it, there are many better alternatives like Thin, Unicorn or Passenger:

cd /usr/ports/www/rubygem-rails
make config

And un-check Mongrel.

NOTE: I experienced an error when generating documentation for i18n during build process, to avoid this you might want to try setting this environment variable:

export RDOCOPT="--encoding=UTF-8"

And finally:

portmaster -Dr ruby

NOTE: If the "ruby" glob matches more than one port you will need to specify the name of the Ruby directory in /var/db/pkg explicitly, e.g.:

portmaster -Dr ruby-1.9.3.392

You should be good to go after this. In my case I still have Ruby 1.8 installed, as to not break other packages that might depend on it, you never know, and I like to feel safe. But if you are feeling optimistic, the command to completely replace old Ruby with newer:

portmaster -o lang/ruby19 lang/ruby18
Say Thanks
Respond