fix nil string for end_with?  when using ruby 2.1
revert to 2.1.2 to reduce build time(50 mins limited)