Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 646
richsinn Avatar asked Sep 24 '12 05:09

richsinn


3 Answers

Another option would be to use Heroku's Postgres.app, I personally find this a bit easier to setup and manage.

http://postgresapp.com/

like image 72
Ron E Avatar answered Oct 26 '22 03:10

Ron E


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.

like image 39
solaimuruganv Avatar answered Oct 26 '22 02:10

solaimuruganv


If you use Postgres.app from Heroku, by adding

export PATH=/Applications/Postgres.app/Contents/MacOS/bin:$PATH

to ~/.bash_profile, it should resolve the issue.

like image 26
Jiro Sasamoto Avatar answered Oct 26 '22 04:10

Jiro Sasamoto