Rewrite install script in ruby