【发布时间】:2016-12-28 10:27:17
【问题描述】:
我在 El Capitan 10.11.6 上并使用 bash。 红宝石 2.3.0 轨道 5.0.0
我一直在学习 ruby/rails,并希望将应用程序推送到 heroku。我已按照heroku documentation 和Postgres.app 文档中列出的步骤进行操作。
我下载了 Postgres.app 并将其移至 Applications 目录。
我把它放在我的 ~/.bash_profileexport PATH=$PATH:/Applications/Postgres.app/Contents/Versions/9.5/bin
然而,当我输入$ which psql 时,我根本没有得到任何信息。此外,$ psql -h loclhost 什么也不做。但是,我可以通过双击图标“启动”Postgres.app,然后在菜单栏中找到大象。
此外,我无法安装gem 'pg'。我得到错误:
Installing pg 0.18.4 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /Users/jesselawson/.rvm/gems/ruby-2.3.0/gems/pg- 0.18.4/ext
/Users/jesselawson/.rvm/rubies/ruby-2.3.0/bin/ruby -r ./siteconf20160821-1410-1o4aen1.rb extconf.rb
checking for pg_config... no
No pg_config... trying anyway. If building fails, please try again with
--with-pg-config=/path/to/pg_config
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
和
An error occurred while installing pg (0.18.4), and Bundler cannot continue.
Make sure that gem install pg -v '0.18.4' succeeds before bundling.
【问题讨论】:
-
您应该针对这些问题发布单独的问题。
-
我的印象是它们可能与同一问题相关并提供更多上下文。 IE。 "这些错误发生在 x 设置不正确时"
-
你试过用自制软件安装 postgres 吗?
标签: bash postgresql heroku ruby-on-rails-5 pg