script refactor to install ruby