Heroku provides a read-only file system on their Bamboo stack, and a "scratch-pad" file system on their Cedar stack where changes are thrown away after the web request finishes.
Thanks, I didn't know that.
I guess the user account has restricted access in what commands are available.
exec('sudo cat /etc/shadow')
=> RestrictedCodeException System Calls disabled
Also, while File.read('/etc/passwd') works, at least File.read('/etc/shadow') doesn't.