0

I'm setting up a new computer to use an existing Rails application (Rails 3.2 with Postgres). I installed postgres via homebrew, along with the Lunchy gem as documented here: http://www.moncefbelyamani.com/how-to-install-postgresql-on-a-mac-with-homebrew-and-lunchy/. No problems getting a user account and starting/running my application. I ran rake db:create:all to create all of the databases. The site works and loads from only one Terminal tab.

When I open a new tab, same location, and try to start the server, I get the following error:

Users/jpetrarca/.rvm/gems/ruby-2.0.0-p247/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:1216:in `initialize': could not connect to server: No such file or directory (PG::Error)
19:24:39 web.1  |   Is the server running locally and accepting
19:24:39 web.1  |   connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"?

I don't know why one terminal session would work and another not.

Interestingly, I can start/stop postgres with lunchy from the non-working terminal and it does, in fact, use the same service and turns off the db being accessed from the working terminal (which is expected).

I initially found this problem while trying to run my rspec tests and connect to the test db.

Chris Travers
  • 25,424
  • 6
  • 65
  • 182
panzhuli
  • 2,890
  • 6
  • 33
  • 46
  • run pg_config in both terminals, maybe you have two postgres versions installed and your path is not setup correctly because that page you linked is setting up homebrew in ~/.bash_profile and the other tabs are not loading it. – Juan Castañeda Oct 30 '13 at 06:19
  • Juan, both tabs show the same exact list for pg_config – panzhuli Oct 30 '13 at 12:38

0 Answers0