what's the error string? have you tried running it manually on the terminal, one line at a time, and see if it works? no i don't think sudo gainroot is necessary