Search code examples
ruby-on-rails-3osx-mountain-lionhomebrewrails-postgresql

Postgresql via homebrew vs. mountain lion OS X


This is bothering me to no end.

I'm setting up a Rails 3.2 environment with Postgresql on my Mac with OS 10.8.2 (Mountain Lion).

I basically followed the directions in the Railscast, and installed postgresql version 9.2.0 via Homebrew. but whenever I do

which psql

and

psql --version

it always shows me the location and version of the system postgresql that came preinstalled with Mountain Lion (/usr/bin/psql and version 9.1.4, respectively), rather than the location and version of the Postgresql that I installed with Homebrew (/usr/local/bin and version 9.2.0, respectively).

I also set up a Launch Agent, so that postgresql automatically starts up when I start the system.

I've even tried following the directions from this blog, and I still get the same results when I run which psql.

However, when I do:

ps -ef | grep postgres

I receive the following results:

501   556   120   0 Fri02AM ??         0:00.12 /usr/local/bin/postgres -D /usr/local/var/postgres -r /usr/local/var/postgres/server.log

Does this mean that I'm running the homebrew version of postgresql?

Do I have to uninstall the system postgresql?


Solution

  • by adding directory path (/usr/local/bin) to the config file, ~/.bash_profile you will get resolve the above issue.

    to know more refer this link.