You probably need to `require 'rubygems'` if you're using Gem.