Upgrade to rails 4, fix deprec warnings