Use LaunchControl to run pg_dump in a ruby file
Thanks to klanomath's comment, the problem is that I am not putting the full file path to pg_dump.

pg_dump is a utility of postgresql which was installed using homebrew. So in my case I did brew info postgresql which told me the path to postgresql.  In the bin directory I found pgdump.

I also put in the full path to where I wanted backup_file saved. This was found by changing to that directory and typing pwd.