Fixing permission issue with ruby script