Upgrade to Rails 4 and fix major breaks