Postgres sh: /usr/local/var/postgres/server.log: No such file or directory

I recently had to reinstall homebrew and postgres and now postgres isn't working with rails.

First when trying to run rails s, I get this:

/Users/lee/.rvm/gems/ruby-1.9.3-p125@achievex/gems/activerecord-3.2.6/lib/active_record/connection_adapters/postgresql_adapter.rb:1206:in `initialize': could not connect to server: Connection refused (PG::Error)

So I try starting postgres and I get this:

pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
server starting
sh: /usr/local/var/postgres/server.log: No such file or directory

It appears that postgres is running because of this:

 ps aux | grep postgreslee             1099   0.3  0.0  2425480    188 s000  R+    5:48PM   0:00.01 grep postgres

I'm totally at a loss here as to why I can't get it running.

Answers


First, ps | grep is in fact pulling your grep out of the process tree. Postgres is not running. This sort of thing happens when the directory to put the log in doesn't exist. So probably you are pointing it at a non-existant directory.

This could happen if you don't have a data directory yet.

Recommendations:

  1. Start by making sure your data directory exists. search for pg_hba.conf and see if it is anywhere on your system. If it is then there is a good chance it is in your data directory (if it is in etc, then look for base/1/PG_VERSION This will be in your data directory one level up from base).
  2. if it exists already change your postgresql.conf to set logging setting appropriately and drop the -l option.
  3. If no data directory exists, use the initdb command to make one.

Need Your Help

How Exactly Do You Build A GUI Application in Squeak

smalltalk pharo squeak

All the tools that i searched are 2005 or 2006 and so i dont even dare to try those. I understand that morphic is ok , but i am looking for something like Morphic Designer.

Will Web Server Log WGet Requests?

logging web request wget

I am new to running servers, but will Wget requests be logged in a web server? What kind of requests will be logged, for example, in Apache?