extract ruby path check in scripts/rvm