Ruby 2.2 removed deprecated APIs.