fix detecting if ruby can be used safely with ruby, update #1580