split out rubygems script as common script