install ruby, detect if sudo needed, fix json file