move to rubygems api to check rubygems version, fix #1977