首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Postgres.app设置:获取“哪个psql`”返回所需路径

Postgres.app设置:获取“哪个psql`”返回所需路径
EN

Stack Overflow用户
提问于 2015-04-29 00:35:04
回答 1查看 3K关注 0票数 1

我刚刚安装了Postgres.app,现在Postgres.app没有返回任何。我跟踪了在Postgres网站上列出的说明;以下是我所做的:

( 1)把我的旧版本的Postgres拖到垃圾桶里。倒垃圾。

2)下载了当前版本的Postgres.app。拖到“应用程序”文件夹。

3)重新启动终端。

我从which psql 中寻找的输出类似于: /Applications/Postgres.app/Contents/Versions/9.3/bin/psql

当我运行brew install postgresqlwhich psql之后,我得到了/usr/local/bin/psql。但这不是我想要的。

如果有用的话,下面是我的.bashrc:

代码语言:javascript
复制
if [ -f ~/.bash_profile ]; then
    source ~/.bash_profile
fi

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

### Added by the Heroku Toolbelt
export PATH="/usr/local/heroku/bin:$PATH"

rvm get stable --auto-dotfiles

export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting

我的.bash_profile:

代码语言:javascript
复制
export PATH=/usr/local/bin:$PATH
export PATH=/usr/local/share/python:$PATH

# Python
export WORKON_HOME=$HOME/.virtualenvs
export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python2.7
export VIRTUALENVWRAPPER_VIRTUALENV_ARGS='--no-site-packages'
export PIP_VIRTUALENV_BASE=$WORKON_HOME
export PIP_RESPECT_VIRTUALENV=true
if [[ -r /usr/local/share/python/virtualenvwrapper.sh ]]; then
    source /usr/local/share/python/virtualenvwrapper.sh
else
    echo "WARNING: Can't find virtualenvwrapper.sh"
fi

export PS1="\h:\w \u\$ "

# for git
LESS="-qrX -P %lt"
export LESS

# colorize shell output
export CLICOLOR=1
export LSCOLORS=Hxfxcxdxbxegedabagacad

#========== ALIASES ===========

alias u="cd .."
alias uu="cd ../.."
alias uuu="cd ../../.."
alias cd..="cd .."
alias rm="rm -i"
alias ll="ls -laFGh"
alias ls="ls -FGh"
alias new="ls -lat | head -15"

# node needs to not have DYLD_LIBRARY_PATH set
alias node="DYLD_LIBRARY_PATH=''; node"

# postgres stuff
PATH="/Applications/Postgres.app/Contents/MacOS/bin:$PATH"
export DYLD_LIBRARY_PATH="/Applications/Postgres.app/Contents/MacOS/lib:$DYLD_LIBRARY_PATH"

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*

非常感谢!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-04-29 01:54:28

一个解决办法!对于后人来说,以下是对我有用的东西:

1)将行export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/9.4/bin添加到.bash_profile中。为了进一步阅读,我在Postgres.app命令行工具页面上找到了这个解决方案。

2)运行brew uninstall postgresql。这似乎不太理想,因为我以后几乎肯定会想要它,但在卸载之前,在运行which psql时,我只知道到brew安装的postgresql的路径。

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/29932347

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档