Using Mac OSX 10.12.5, I have a ruby file with the following contents

#!/usr/bin/env ruby
Dir.chdir('/Users/my_files') do
  system("pg_dump -Fc --no-acl --no-owner -h localhost -U MyName development > backup_file.dump")

it works if I run it from the command line, but if I run it from LaunchControl I get the following error:

sh: pg_dump: command not found

How do I fix this?

  • 2
    Use the full path for pg_dump (and probably also for the file backup_file.dump)!
    – klanomath
    Jun 21, 2017 at 23:36

1 Answer 1


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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .