Check if ruby_version is not nil before running .match against 1.8.7