ETA: The possible answer above does NOT answer my question. I'm unable to create those directories.
After a trip to the Apple Store for repairs, my macbook came back upgraded with Yosemite. My dev environment is working fine EXCEPT for Postgres. I reinstalled with homebrew and when I type "psql" into my terminal I get this:
$ psql
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
I've tried pretty much every suggestion on the site to no avail. Whenever I try to change anything, I get permission denied and it doesn't work even with a SUDO.
Some things I've tried:
$pg_ctl initdb
Result:
The files belonging to this database system will be owned by user "**********".
This user must also own the server process.
The database cluster will be initialized with locale "en_US.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".
Data page checksums are disabled.
creating directory /var/lib/pgsql/data ... initdb: could not create directory
"/var/lib/pgsql": Permission denied
pg_ctl: database system initialization failed
I've tried using Lunchy
$ lunchy start postgres
/usr/local/Cellar/postgresql/9.4.0/homebrew.mxcl.postgresql.plist: File exists
started homebrew.mxcl.postgresql
Didn't work.
Tried this too:
$ ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents
‘/Users/**************/Library/LaunchAgents/homebrew.mxcl.postgresql.plist’ -> ‘/usr/local/opt/postgresql/homebrew.mxcl.postgresql.plist’
And a few other methods.
Postgres is located here: /usr/local/bin/postgres
on my computer. Should it be moved?
Does anybody have any step by step instructions I can try? I feel like I've tried everything and I'm really at a loss here because it shouldn't be this difficult. Thanks!