我如何设置heroku postgresql应用程序的路径? [英] How can i setup the path for heroku postgresql app?

查看:131
本文介绍了我如何设置heroku postgresql应用程序的路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚安装了heroku PSQL应用程序(v1.0),我无法使用gem pg0.1.4连接我的rails应用程序。我已经将路径PATH =/ Applications / Postgres.app / Contents / MacOS / bin:$ PATH添加到我的.profile和我的.bashrc文件中,但似乎只允许我通过调用psql来运行psql。我使用psql -h localhost成功了。当我去psql时,我得到:

 服务器是否在本地运行并接受Unix域套接字上的
连接/var/pgsql_socket/.s.PGSQL.5432?

我正在使用山狮。

解决方案

还是很确定现有的两个答案都回答了错误的问题。作者在标题中提到他在 PATH 方面遇到问题,而没有连接到他的数据库或配置rails。这是我遇到的情况,这是我的解决方案。



在我的.bashrc文件中运行postgres.app并设置 PATH 之后按照postgress.app文档中的指示 - http://postgresapp.com/documentation

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

问题在于,重新启动terminal.app后,此路径设置未起作用 - 正在运行哪个psql将副本返回到/ usr / bin / psql中,这是随Lion和Mountain Lion一起安装的副本,而不是安装在/ Applications /中的新版本。它甚至在Postgres.app指令中说:运行哪个psql来告诉正确的版本正在被加载。

无论如何 - 我发现的奇怪之处是,在我ran:

 源.bashrc 

然后命令psql将返回位于/ ​​Applications /中的正确版本。



在这一点上,我被困住了,不得不获得一些额外的帮助。我窃听的人也认为这很奇怪,但他们很快发现 .bashrc或.profile文件都没有被加载。这很奇怪,我没有看到这个我的其他mac通过狮子运行豹。



现在终于解决方案 - 我不确定这是否正确,但它确实永久解决了我的问题问题。我们发现他们是一个正在加载到终端的配置文件 - .bash_login 文件。最后,解决方案只是使用.bash_login来源.bashrc文件。这里是对.bash_login的编辑:

 源$ HOME / .bashrc 

这就是它。



无论如何,我不能说这正是解决方案diego需要/正在寻找,但这绝对是我的问题。


I just installed the heroku PSQL app (v1.0) and i'm having trouble being able to connect my rails apps using the gem pg "0.1.4". I already added the path PATH="/Applications/Postgres.app/Contents/MacOS/bin:$PATH" to my .profile and my .bashrc files, but nothing seems to allow me to run psql simply by calling "psql". I had success using "psql -h localhost". When i go for "psql" i get:

Is the server running locally and accepting
connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"?

I'm using mountain lion.

解决方案

Still pretty sure that both of the existing answers are answering the wrong question. The author mentions right in the title that he is having trouble with PATH, not connecting to his DB or configuring rails. This is the situation I got into, and this is my solution.

After getting postgres.app running and setting PATH in my .bashrc file as directed in the postgress.app documentation - http://postgresapp.com/documentation :

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

The problem was that this path setting was not taking effect after restarting terminal.app - running which psql was returning the copy in "/usr/bin/psql", this is the copy that comes installed with Lion and Mountain Lion, not the new version installed in "/Applications/". It even says in the Postgres.app instructions "run which psql to tell that the correct version is being loaded".

Anyway - the odd thing I found was that after I ran:

source .bashrc

Then the command "which psql" would return the correct version located in /Applications/.

At this point I was stumped and had to get some extra help. The guys I tapped also thought it was quite odd too, however they quickly found out that neither the .bashrc OR the .profile files were being loaded. This is very strange, I have not seen this on any of my other macs running leopard through lion.

Now finally the solution- I am not sure this is proper, but it did permanently fix my problem. We found that their was one profile file being loaded into the terminal - the .bash_login file. In the end the solution was just to use the .bash_login to source the .bashrc file. Here is the edit to .bash_login:

source $HOME/.bashrc

And that did it.

Anyway I can't say that this is exactly the fix that diego needed / was looking for, but it is definitely the problem for me.

这篇关于我如何设置heroku postgresql应用程序的路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆