in Hacking

Freebsd – Broken Ruby Installation After Update

Yesterday I did a Ruby update of my Freebsd ports.
It mentioned Ruby needed to be updated. I always thinks this is Scary because I have several sites depending on the my Ruby installation.
You need to update once in a while, so I just upgraded it...

portupgrade -bapi

Today I saw my mysql-backup-cron Ruby script gave the following error:

mysql_backup.rb:3:in `require': no such file to load -- rubygems (LoadError)
	from mysql_backup.rb:3:in `<main>

WTF. I tried to run a rake task of my Rails apps.. The same error...

The gems still seem work. The command below nicely showed my Gems.

gem list 

After trying to reinstall the rubygems port which didn't do a thing.
I found the solution was to REINSTALL RUBY completely.

cd /usr/lang/ruby18
make 
make deinstall
make install clean

BTW. My Rails apps were not affected because they run in an RVM environment ...