I have a Rails 3.0.7 running on Mac OSX Snow Leapard.
The database works and the site is up and running.
I went to try out the new rails db console and it produced the following error:
Couldn't find database client: psql. Check your $PATH and try again.
When I try:
$ which psql
it returns nothing.
Here is my .profile bash file:
export PATH="$HOME/ImageMagick-6.6.9/bin:/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin::$PATH"
export SQL_PATH=$HOME/Library/PostgreSQL/9.1
export MAGICK_HOME="$HOME/ImageMagick-6.6.9"
export DYLD_LIBRARY_PATH="$MAGICK_HOME/lib/"
# Load RVM into a shell session *as a function*
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
I am exporing the path for Postgres.
How can I get the Rails db to find my psql?
To your .profile
bash file, add the following:
PATH=$PATH:/usr/lib/pgsql/bin
Replace the path /usr/lib/pgsql/bin
with the path to your pgsql bin.
I'm on Mac, with Postgres.app.
I updated my .bash_profile like this
open ~/.bash_profile
adding
PATH=$PATH:/Applications/Postgres.app/Contents/Versions/9.3/bin
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