If you try to build Ruby 1.8.7 with RVM you will see:

1
2
3
4
5
# rvm install 1.8.7
[...]
./lib/fileutils.rb:1430: [BUG] unexpected local variable
ruby 1.8.7 (2012-02-08 patchlevel 375) [amd-freebsd10]
*** [./.rbconfig.time] Signal 6

This is because FreeBSD 10 ships with the Clang compiler instead of GCC and Ruby versions priory to 1.9.3-p194 do not support Clang.

The work-around, is to install GCC, either with pkg:

1
# pkg install gcc

or from Ports:

1
2
# cd /usr/ports/lang/gcc
# make install clean

Once you have gcc you can install 1.8.7 with:

1
# CC=/usr/local/bin/gcc47 rvm install 1.8.7

This should work with older versions of Ruby 1.9 as well.

What on earth would you want to install 1.8.7? Two words: Legacy Apps…

Comments