converted install script from Perl to Ruby