Fix rugged version and repo discovery

Rugged 0.21.0 uses a different api for the discovery and returns an object instead of a string, so `gsub` was not available.