I have been using the same Postgres database in the same application for a month without any problems, and I did not change anything in the database before this error accidentally appeared today. However, today Postgres accidentally started throwing this error when I try "rails s" (I get the same type of error when running createb or createuser):
Exit /Users/Joe/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.2/lib/active_record/connection_adapters/postgresql_adapter.rb:1194:in `initialize ': failed to connect to server: No such file or directory (PG :: Error) Does the server work locally and accept connections to the Unix domain for the domains "/tmp/.s.PGSQL.5432"?
What is really strange is that yesterday my friend had the same errors (working on the same application), and he was corrected by him using the script from http://nextmarvel.net/blog/2011/09/ brew-install-postgresql-on-os-x-lion / . After running the script, he uninstalled and reinstalled the PG gem to make it work. However, it works with OS X Lion, and I run Snow Leopard, so the script will not work for me.
Any ideas (1) why this will accidentally start happening and (2) how to fix it?
source share