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?
Another option would be to use Heroku's Postgres.app, I personally find this a bit easier to setup and manage.
http://postgresapp.com/
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With