I\'m writing a rake script and would like to detect (using Ruby rather than bash if possible) if the user who executed the rake script has root privileges.
If it is not
Use uid or euid in the Process class:
raise 'Must run as root' unless Process.uid == 0